haxeui-html5
is the pure HTML5 backend for HaxeUI. It has no other framework dependency except haxeui-core
itself and outputs a DOM tree.
haxeui-html5
has a dependency tohaxeui-core
, and so that too must be installed.
Eventually all these libs will become haxelibs, however, currently in their alpha form they do not even contain a haxelib.json
file (for dependencies, etc) and therefore can only be used by downloading the source and using the haxelib dev
command or by directly using the git versions using the haxelib git
command (recommended). Eg:
haxelib git haxeui-core https://github.com/haxeui/haxeui-core
haxelib dev haxeui-html5 path/to/expanded/source/archive
The simplest method to create a new HTML5 application that is HaxeUI ready is to use one of the haxeui-templates. These templates will allow you to start a new project rapidly with HaxeUI support baked in.
If however you already have an existing application, then incorporating HaxeUI into that application is straightforward:
If you are using a command line build (via a .hxml
file) then add these two lines:
-lib haxeui-core
-lib haxeui-html5
If you are using an IDE, like Flash Develop, add these lines via the project settings window.
Note: Currently you must also include haxeui-core
explicitly during the alpha, eventually haxelib.json
files will exist to take care of this dependency automatically.
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
, it is also possible to add components directly to any other DOM node: the haxeui-html5
backend exposes a special element
property for this purpose. Eg:
js.Browser.document.getElementById("myContainer").appendChild(main.element);
The configuration options that may be passed to Tookit.init()
are as follows:
Toolkit.init({
container: js.Browser.document.getElementById("myContainer") // where 'Screen' will place components
// defaults to the document body
});
HTML5 supports various native versions of components, and therefore so does HaxeUI. There are a few different ways to do this:
Toolkit.theme = "native"; // will try to use native components where possible
var button:Button = new Button();
button.native = true; // this component alone will be native
<button text="Native" style="native:true;" />
.button, #myNativeButton, .myNativeStyle {
native: true;
}
- haxeui-api - The HaxeUI api docs.
- haxeui-guides - Set of guides to working with HaxeUI and backends.
- haxeui-demo - Demo application written using HaxeUI.
- haxeui-templates - Set of templates for IDE's to allow quick project creation.
- haxeui-bdd - A behaviour driven development engine written specifically for HaxeUI (uses haxe-bdd which is a gherkin/cucumber inspired project).
- WWX2016 presentation - A presentation given at WWX2016 regarding HaxeUI.