test
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
||||
2520
|
||||
2526
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@ class UISprite extends FlxSprite {
|
||||
}
|
||||
|
||||
public function drawMembers() {
|
||||
|
||||
@:privateAccess {
|
||||
__oldDefCams = FlxCamera._defaultCameras;
|
||||
FlxCamera._defaultCameras = cameras;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user