diff --git a/buildnumber.txt b/buildnumber.txt index ea14c70b..64d4e291 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -2520 \ No newline at end of file +2526 \ No newline at end of file diff --git a/source/funkin/editors/UIDebugState.hx b/source/funkin/editors/UIDebugState.hx index b29ca0d1..0aa8fdea 100644 --- a/source/funkin/editors/UIDebugState.hx +++ b/source/funkin/editors/UIDebugState.hx @@ -15,6 +15,6 @@ class UIDebugState extends UIState { add(new UICheckbox(10, 40, "Test checked", true)); add(new UIButton(10, 70, "Test button", function() { trace("Hello, World!"); - }, 120, 20)); + }, 120, 32)); } } \ No newline at end of file diff --git a/source/funkin/editors/ui/UIButton.hx b/source/funkin/editors/ui/UIButton.hx index 08d46cde..971b30e2 100644 --- a/source/funkin/editors/ui/UIButton.hx +++ b/source/funkin/editors/ui/UIButton.hx @@ -15,11 +15,14 @@ class UIButton extends UISprite { field.fieldWidth = w; } - public override function new(x:Float, y:Float, text:String, callback:Void->Void, w:Float = 120, h:Float = 20) { + public override function new(x:Float, y:Float, text:String, callback:Void->Void, w:Float = 120, h:Float = 32) { super(x, y); frames = CoolUtil.loadFrames(Paths.image('editors/ui/button')); this.callback = callback; members.push(field = new UIText(x, y, w, text)); + field.borderStyle = OUTLINE; + field.borderColor = 0x88000000; + field.borderSize = 1; field.alignment = CENTER; } @@ -38,7 +41,6 @@ class UIButton extends UISprite { } public override function draw() { - field.follow(this, 0, ((height - field.height) / 2)); var x:Float = this.x; var y:Float = this.y; var offset:Int = hovered ? (pressed ? 18 : 9) : 0; @@ -111,6 +113,8 @@ class UIButton extends UISprite { setPosition(x, y); + field.follow(this, 0, ((bHeight - field.height) / 2)); + super.drawMembers(); } diff --git a/source/funkin/editors/ui/UISprite.hx b/source/funkin/editors/ui/UISprite.hx index 21e13fcc..718cee9a 100644 --- a/source/funkin/editors/ui/UISprite.hx +++ b/source/funkin/editors/ui/UISprite.hx @@ -44,7 +44,6 @@ class UISprite extends FlxSprite { } public function drawMembers() { - @:privateAccess { __oldDefCams = FlxCamera._defaultCameras; FlxCamera._defaultCameras = cameras; diff --git a/source/funkin/editors/ui/UIText.hx b/source/funkin/editors/ui/UIText.hx index 960dc2cb..ada67832 100644 --- a/source/funkin/editors/ui/UIText.hx +++ b/source/funkin/editors/ui/UIText.hx @@ -1,10 +1,12 @@ package funkin.editors.ui; +import flixel.util.FlxColor; import funkin.ui.FunkinText; class UIText extends FunkinText { // PUTTING THIS HERE IN CASE IMMA MAKE FUTURE CHANGES - public function new(x, y, w, text, size:Int = 14) { + public function new(x, y, w, text, size:Int = 15, color:FlxColor = 0xFFFFFFFF) { super(x, y, w, text, size, false); + this.color = color; } } \ No newline at end of file