bright-gpu-74537
06/11/2021, 5:57 PMbright-gpu-74537
06/11/2021, 5:58 PMbright-gpu-74537
06/11/2021, 5:59 PMbright-gpu-74537
06/11/2021, 6:31 PMbright-gpu-74537
06/11/2021, 6:31 PM@:xml('
<hbox>
<button id="button1" text="Button1" />
<button id="button2" text="Button2" />
</hbox>
')
class MyCustomComponent extends HBox {
public function new() {
super();
}
@:event(MyCustomEvent.FOO) public var onFoo:MyCustomEvent->Void;
@:event(MyCustomEvent.BAR) public var onBar:MyCustomEvent->Void;
@:bind(button1, MouseEvent.CLICK)
private function onButton1(_) {
dispatch(new MyCustomEvent(MyCustomEvent.FOO, 101));
}
@:bind(button2, MouseEvent.CLICK)
private function onButton2(_) {
dispatch(new MyCustomEvent(MyCustomEvent.BAR, 102));
}
}
class MyCustomEvent extends UIEvent {
public static inline var FOO:String = "foo";
public static inline var BAR:String = "bar";
public var myspecialdata:Int = 0;
public function new(type:String, myspecialdata:Int) {
super(type);
this.myspecialdata = myspecialdata;
}
public override function clone():MyCustomEvent {
var c = new MyCustomEvent(this.type, this.myspecialdata);
return c;
}
}bright-gpu-74537
06/11/2021, 6:32 PMbright-gpu-74537
06/11/2021, 6:32 PMhaxe
var x = new MyCustomComponent();
x.registerEvent(MyCustomEvent.FOO, function(e:MyCustomEvent) {
trace(e.myspecialdata);
});
x.registerEvent(MyCustomEvent.BAR, function(e:MyCustomEvent) {
trace(e.myspecialdata);
});
x.onFoo = function(e) {
trace(e.myspecialdata);
}most-caravan-45834
06/11/2021, 6:32 PMbright-gpu-74537
06/11/2021, 6:32 PMbright-gpu-74537
06/11/2021, 6:32 PMhaxe
@:bind(myCustomComponent, MyCustomEvent.FOO)
private function onFoo(e:MyCustomEvent) {
trace(e.myspecialdata);
}
@:bind(myCustomComponent, MyCustomEvent.BAR)
private function onBar(e:MyCustomEvent) {
trace(e.myspecialdata);
}bulky-exabyte-6537
06/11/2021, 10:34 PMbulky-exabyte-6537
06/11/2021, 10:35 PMmost-caravan-45834
06/12/2021, 12:10 AM"assets.haxeui.xml.lobby.item.ItemSlot should be entity.ui.lobby.item.ItemSlot"most-caravan-45834
06/12/2021, 12:16 AMbulky-exabyte-6537
06/12/2021, 12:29 AMbulky-exabyte-6537
06/12/2021, 12:29 AMbulky-exabyte-6537
06/12/2021, 12:44 AMcomponentWidth instead of actualComponentWidth inside centerDialogComponent() calculations fixes it for memost-caravan-45834
06/12/2021, 5:23 AMbright-gpu-74537
06/12/2021, 7:20 AMbright-gpu-74537
06/12/2021, 7:21 AMbulky-exabyte-6537
06/12/2021, 9:19 AMactualComponentWidth and actualComponentHeight btw)bulky-exabyte-6537
06/12/2021, 9:21 AMactualComponentWidth/Height is supposed to be the unscaled sizebulky-exabyte-6537
06/12/2021, 9:22 AMScreen.instance.width/height is the scaled sizebulky-exabyte-6537
06/12/2021, 9:22 AMvar x = (Screen.instance.width / 2) - (dialog.actualComponentWidth / 2); is a mistake?bright-gpu-74537
06/12/2021, 9:25 AMbulky-exabyte-6537
06/12/2021, 9:40 AMactualComponentWidth/Height and Screen.instance.width/height in MenuBar, Menu, and DropDown that could be worth a lookbright-gpu-74537
06/12/2021, 9:42 AMbright-gpu-74537
06/12/2021, 9:42 AMbright-gpu-74537
06/12/2021, 5:58 PMmost-caravan-45834
06/12/2021, 6:22 PM