Add callback handling to MexUI Image control

This commit is contained in:
Vortrex
2022-05-15 04:22:01 -05:00
parent 9b9c1bb608
commit 86b9584010

View File

@@ -17,4 +17,14 @@ mexui.Control.Image.prototype.render = function()
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'));
};
// input
mexui.Control.Image.prototype.onMouseDown = function(e)
{
if(e.button == 0 && this.isCursorOverControl())
{
e.used = true;
this.checkToCallCallback();
}
};