GithubHelp home page GithubHelp logo

hhy5277 / haxeui-core Goto Github PK

View Code? Open in Web Editor NEW

This project forked from haxeui/haxeui-core

0.0 1.0 0.0 3.51 MB

The core library of the HaxeUI framework -

Home Page: http://haxeui.org

Batchfile 0.13% Haxe 97.34% HTML 0.16% CSS 2.24% Ruby 0.13%

haxeui-core's Introduction

Build Status Code Climate Issue Count Support this project on Patreon

haxeui-core

haxeui-core is a users universal entry point into the HaxeUI framework and allows for the same user interface code (either with markup or via haxe source code) to be used to build a user interface on various platforms using various HaxeUI backends. Below is a general overview of how haxeui-core and the various HaxeUI backends fit together. You can watch a presentation (given at WWX2016) about HaxeUI to get more of an understanding here.

Installation

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-openfl path/to/expanded/source/archive

Backends

In general, using a HaxeUI backend is as simple as just including haxeui-core and the backend library into your application, for example:

-lib haxeui-core
-lib haxeui-openfl

Currently, HaxeUI supports the following backends. Please refer to each backend for specific instructions on how to set-up and initialise the host framework (if required).

Backend Library Dependencies Platforms Native Components CI
haxeui-openfl OpenFL / Lime Build Status
haxeui-kha Kha Build Status
haxeui-html5 none Build Status
haxeui-pixijs PixiJS Build Status
haxeui-nme NME Build Status
haxeui-hxwidgets hxWidgets / wxWidgets Build Status
haxeui-flixel Flixel / OpenFL / Lime

Usage

Assuming that haxeui-core and the backend library have been included in your application, initialising the toolkit and using it should be relatively straight forward:

Toolkit.init();

The init function can take an optional Dynamic argument that allows certain options to be passed to the host framework. Please refer to each specific backend on how to use these.

Once the toolkit has been initialised components can be added in one of two ways:

Adding components using Haxe code

Using HaxeUI components in haxe code is simple and easy:

import haxe.ui.components.Button;
import haxe.ui.containers.VBox;
import haxe.ui.core.Screen;

var main = new VBox();

var button1 = new Button();
button1.text = "Button 1";
main.addComponent(button1);

var button2 = new Button();
button2.text = "Button 2";
main.addComponent(button2);

Screen.instance.addComponent(main);

Note: Screen was used here as a universal way to add items to the application, this is not required however, if you are using a single framework and are not interested in the cross-framework capabilities of HaxeUI, then you can use something more specific to the target framework (eg: Lib.current.stage.addChild(main)).

Adding components from markup

It is also possible for HaxeUI to take a user interface definition from a markup language (like XML) and use that to build code similar to above:

var main = ComponentMacros.buildComponent("assets/ui/demo/main.xml");
Screen.instance.addComponent(main);

If your xml isn't available at compile time you can use Toolkit.componentFromString:

var main = Toolkit.componentFromString('<vbox><button text="Button" /></vbox>', "xml");
Screen.instance.addComponent(main);

Additional resources

  • 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 IDEs 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.

haxeui-core's People

Contributors

adrianv avatar alamboley avatar aw4kening avatar bendmorris avatar hasufel avatar ianharrigan avatar ibilon avatar markknol avatar msghero avatar sh-dave avatar simn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.