haxeui-nme is the NME backend for HaxeUI.
haxeui-nme has a dependency to haxeui-core, and so that too must be installed. Once haxeui-core is installed, haxeui-nme can be installed using:
haxelib install haxeui-nme
haxeui-nme also has a dependancy on NME, this can be installed via haxelib using the following commands:
haxelib install nme
haxelib run nme setup
The simplest method to create a new NME application that is HaxeUI ready is to use the HaxeUI command line tools. These tools will allow you to start a new project rapidly with HaxeUI support baked in. To create a new skeleton application using haxeui-nme run the following command in the folder where Kha has been installed:
haxelib run haxeui-core create NME
If however you already have an existing application, then incorporating HaxeUI into that application is straightforward:
Simply add the following lines to your project.nmml
.
<haxelib name="haxeui-core" />
<haxelib name="haxeui-nme" />
Initialising the toolkit requires you to add this single line somewhere before you start to actually use HaxeUI in your application:
Toolkit.init();
Once the toolkit is initialised you can add components using the methods specified here.
As well as using the generic Screen.instance.addComponent
, since HaxeUI components in haxeui-nme extend from nme.display.Sprite
it is also possible to add components directly to any other NME sprite (eg: Lib.current.stage.addChild
).