Initial commit

This commit is contained in:
VortrexFTW
2020-09-04 15:56:19 -05:00
commit c536fcd6ef
245 changed files with 14997 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
mexui.util.createControlConstructor('ProgressBar', false, function(window, x, y, w, h, text, styles)
{
mexui.Component.Control.call(this, window, x, y, w, h, this.linkControlStyles('ProgressBar', styles));
this.text = text;
this.progress = 0.0;
});
// default styles
mexui.util.linkBaseControlStyles('ProgressBar', {
innerBar:
{
backgroundColour: toColour(0, 255, 0, 255),
hover:
{
backgroundColour: toColour(80, 255, 0, 255)
}
}
});
// render
mexui.Control.ProgressBar.prototype.render = function()
{
var pos = this.getScreenPosition();
mexui.native.drawRectangle(pos, this.size, this.getStyles('main'));
var innerBarSize = new Vec2(this.size.x * this.progress, this.size.y);
mexui.native.drawRectangle(pos, innerBarSize, this.getStyles('innerBar'));
if(this.text != '')
mexui.native.drawText(pos, this.size, this.text, this.getStyles('main'));
};