-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGui.js
37 lines (34 loc) · 799 Bytes
/
Gui.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
function Gui()
{
system.log("Constructing Gui base...");
var self = this;
this.update = function()
{
if(system.debug){ debug.update(); }
gm.update();
}
this.draw = function()
{
gm.draw();
if(system.debug){ debug.draw(); }
}
//Utility Functions
this.drawText = function(textHash)
{
canvas.fillStyle = textHash.color;
canvas.font = textHash.font;
canvas.textAlign = textHash.alignX;
canvas.textBaseline = textHash.alignY;
canvas.fillText(textHash.text, textHash.x, textHash.y);
}
}
function GUIText(Text, X, Y, fStyle, aX, aY, col)
{//new GUIText("The String", x, y, "18px Helvetica", "center", "top", "rgb(96, 255, 96)");
this.text = Text;
this.x = X;
this.y = Y;
this.fontStyle = fStyle;
this.alignX = aX;
this.alignY = aY;
this.color = col;
}