MexUI stuff

This commit is contained in:
Vortrex
2022-05-15 22:26:31 -05:00
parent c81f511448
commit 4b7f05a482
42 changed files with 423 additions and 398 deletions

View File

@@ -1,7 +1,7 @@
mexui.util.createControlConstructor('Button', false, function(window, x, y, w, h, text, styles, callback)
{
mexui.Component.Control.call(this, window, x, y, w, h, this.linkControlStyles('Button', styles), callback);
this.text = text;
});
@@ -31,10 +31,10 @@ mexui.Control.Button.prototype.onKeyDown = function(e, key, mods)
mexui.Control.Button.prototype.render = function()
{
var pos = this.getScreenPosition();
mexui.native.drawRectangle(pos, this.size, this.getStyles('main'));
mexui.native.drawText(pos, this.size, this.text, this.getStyles('main'));
if(this.isFocused())
mexui.native.drawRectangleBorder(mexui.util.subtractVec2(pos,new Vec2(2,2)), mexui.util.addVec2(this.size,new Vec2(3,3)), this.getStyles('focused'));
};