yesterday I stumbled across the Haxe NME project, which is a very promising idea. However, it is still not possible to build sophisticated UIs with this framework. In my opinion it seems to be a intimidating task to build a UI framework that targets so many different platforms, hence I think that this isn't a viable approach, because even old and mature UI frameworks like Qt and wxWidgets don't support so many platforms.
However, it could make sense to build a platform specific UI with help of some pretty UI designer tool and then connect the UI code to the UI agnostic code that has been written in Haxe. I don't know if this could work, because I couldn't find any example, but maybe someone who has already written some MVC Haxe code, that could be successfully connected to different platform specific UIs, would like to share his experiences. Thanks.
You say:
However, it is still not possible to build sophisticated UIs
Just because you haven't yet figured out how to do it doesn't mean it's not possible ;)
The reason it is possible is that in the Haxe ecosystem, the language and compiler is extremely consistent cross platform, NME/OpenFL provides a fairly strong cross platform rendering environment (HTML 5 has some quirks, but the others seem fairly strong) and so anything you build on top of these is going to cover a lot of platforms out-of-the-box. It's about being fairly high level - letting the compiler and the libraries take care of the platform quirks.
In MVC, the UI stuff is usually the "View". For View / UI frameworks, check out these libraries:
Stablex UI
NME/OpenFL, Cross Platform. Draws components using NME API. This is
the only one I've played with, but the demo works consistently on android,
flash, html5, native linux. Pretty impressive.
HaxeUI
NME, Cross Platform. Again, draws components on the stage.
Prime
Drawn using Flash API. Not sure if it has been ported cross platform yet.
See also Talk/Video from WWX conference and Slides
Guise
A really innovative way of being able to either draw the UI, or use native if available. Check out the blog post.
Basis
Another attempt at wrapping native components - has iOS and Android libraries so far. Pretty cool, but I haven't played with it yet.
For MVC, there are lots of options:
The advantage of the MVC frameworks is that they separate your views from your application data (model) and logic (controller). Try to spend some time familiarising yourself with one of the MVC frameworks, and you'll see how you can write your apps in a way where you could use one of these, and then any of the various view engines - either native or NME-rendered. It can be a fairly steep learning curve, but this is how you build apps that are easily portable between different UI frameworks, and easily testable so you know they will scale as the app grows in complexity.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With