I need to be able to just control all the components in haxe without an xml but i don’t know how to do that. If anyone could give me an example for a dropdown component or a link to where i could find this info that would be much appreciated!
You should be able to just use the components as if they were flixel components (in haxeui-flixel they eventually_ extend from FlxSpriteGroup)
So you should be able to just do:
var button = new Button();
add(button);
Make sure you have init’d the toolkit somewhere with:
Toolkit.init();
Cheers,
Ian
Thanks for the support! Kind of forgot I asked, I did get it to work a bit ago and It’s been such a great help! I couldn’t get it to work with what the tutorials on the website told me but I found a game that was open source that uses it and here is their solution:
@:privateAccess {
if (haxe.ui.Toolkit._initialized) {
FlxG.signals.postGameStart.add(haxe.ui.core.Screen.instance.onPostGameStart);
FlxG.signals.postStateSwitch.add(haxe.ui.core.Screen.instance.onPostStateSwitch);
FlxG.signals.preStateCreate.add(haxe.ui.core.Screen.instance.onPreStateCreate);
}
else
haxe.ui.Toolkit.init();
}
override function destroy():Void {
super.destroy();
// temporary fix for haxeui crash
@:privateAccess {
FlxG.signals.postGameStart.remove(haxe.ui.core.Screen.instance.onPostGameStart);
FlxG.signals.postStateSwitch.remove(haxe.ui.core.Screen.instance.onPostStateSwitch);
FlxG.signals.preStateCreate.remove(haxe.ui.core.Screen.instance.onPreStateCreate);
}
}
after I added those things It worked!