3 ms·
Cross-platform tools often have a single user interface that tends to look foreign on every platform (sencha touch), or they force you to code a different ui fo
by zupatol 14y ago
Cross-platform tools often have a single user interface that tends to look foreign on every platform (sencha touch), or they force you to code a different ui for every targeted platform (titanium?).
How is the ui problem is usually tackled with haxe? I tried googling a bit, but didn't come up with a conclusive answer.
- joneil 14y agoThe short answer is that Haxe isn't very good here yet. Many of the companies using Haxe are game studios, and so they just invent their own UI and it doesn't matter if it doesn't feel "native". In terms of the two approaches you mentioned: both can be used. There are various projects to "reinvent" a basic UI toolkit that works on NME, the cross platform graphics layer. These libraries would do what you mentioned first - have a consistent experience across platforms, but one that is foreign and probably not as polished. No libraries have really gained a huge amount of support for this yet, though it seems there are a few trying. The other approach - integrating with native UI - is also possible using Externs, which link in with an underlying system. I'm not sure how much use this has had. Some iOS features have externs, and on the desktop wxWidgets externs are around so this approach is possible. If you were to do this I guess you'd try to abstract away as many differences as you can, so that you need as little conditional compilation as possible. Not sure who is trying this at the moment. As I said though, UI toolkits is definitely not a strong point. My main development with Haxe is for JS / HTML, so I just use standard bootstrap / jQuery elements, which feel "web native" I suppose.
- wiradikusuma 14y agothen why dont you use plain html/js instead? skip extra 'translation' step.
- giulianob 14y agoAs someone else mentioned, Haxe is mainly used for games where the UI is always custom anyways. There are frameworks like ASwing which work with Haxe to give a very flexible UI but it's not a native look and feel.
- novalis 14y agoCross plat native look and feel works through waxe: http://lib.haxe.org/p/waxe http://lib.haxe.org/p/waxe The new java target and already available JNI usage targets Android. There is also http://lib.haxe.org/p/hxffi http://lib.haxe.org/p/hxffi and a established way to call iOs framework code with hxcpp, which is through the CFFI . You should probably have a read (mostly for Cauê Waneck's posts): https://groups.google.com/forum/#!topic/haxelang/9_FHI5cDue0 https://groups.google.com/forum/#!topic/haxelang/9_FHI5cDue0