HashLink GUI & dynamic loading possibilities

400 views
Skip to first unread message

Thomas John

unread,
Nov 9, 2016, 4:01:26 PM11/9/16
to Haxe
Hi,

I'm trying to find out if I could port my Adobe Air App to HashLink with all the custom UI I made in vector.
It's a game development IDE : https://www.youtube.com/watch?v=yi2DcOgt530

I would love to use the speed of the HashLink compiler to make development/testing much easier and also use Haxe as a programming language as I'm really getting to love it.
Also is it possible to dynamically load a "program" inside another "program". Just like in Flash where you would load an external swf into a main swf.
Would the memory be shared ? would it be easy to unload that "program" from the main one ?

Thanks a lot.

Thomas.

Nicolas Cannasse

unread,
Nov 10, 2016, 12:11:36 PM11/10/16
to haxe...@googlegroups.com
Hi,

Yes, it should be feasible to dynamically load different programs,
although it's not yet available.

It would require to know if we want them to access the same globals
table (for classes/statics/etc.) or have them entirely isolated from
another, only communicating through specific API calls.

Also, you need a graphics toolkit to display your app. ATM Heaps engine
supports HL (http://github.com/ncannasse/heaps) using SDL2+OpenGL but it
does not support very well vector graphics (there is basic support for
it in h2d.Graphics). OTOH Heaps is entirely GPU accelerated

Hope it helps,

Nicolas

Tarwin Stroh-Spijer

unread,
Nov 10, 2016, 6:08:55 PM11/10/16
to haxe...@googlegroups.com
If you are moving from Air to Haxe can I suggest you target OpenFL instead? I'm sure at some point (hoping?) that OpenFL will support HL. This way it would make moving your code base a lot easier (as OpenFL API is very Flash-like) and give you target systems right away (including HTML/JS, Flash and native).



Tarwin Stroh-Spijer
_______________________

phone: +1 650 842 0920

Developer at Fanplayr Inc. (Palo Alto)
Original at Touch My Pixel (touchmypixel.com)
_______________________



--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
--- You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.

Thomas John

unread,
Nov 13, 2016, 11:12:05 AM11/13/16
to Haxe, tar...@touchmypixel.com
Hi

thanks for the replies.
I think I'll stick to AIR at the moment.

Heaps is GPU only: I have the feeling that triangulating fonts and vectors with quite a lot of details won't look good.
OpenFL: it seems that it has matured quite a lot since last time I checked. I wasn't a big fan of it before (many bugs on specific platforms, lack of official stage3d support) but things seem to have changed, I'll have another look.

HL looks very promising, especially for fast iterative development. I'm really keeping an eye on this.

I saw in one of your Youtube video that you were going to move away from AIR for your next project. Does that mean that heaps won't support AIR at all anymore ?


thanks !

JLM

unread,
Nov 14, 2016, 7:17:43 AM11/14/16
to Haxe, tar...@touchmypixel.com
Thomas

Fonts are rebuilt as raster for 'gl' and might be quite good depending on toolkit you should probably test.
http://gamehaxe.com/2011/03/28/nme-font-rendering/
https://github.com/KTXSoftware/Kha/blob/master/Sources/kha/graphics2/truetype/StbTruetype.hx#L556

For svg and swf OpenFL/NME have support
https://github.com/nmehost/gm2d/tree/master/gm2d
https://github.com/openfl/svg
https://github.com/openfl/swf

Or on Luxe, Kha and Flambe you need triangles as they don't seem to have much vector support...
https://github.com/KTXSoftware/Kha/blob/master/Sources/kha/graphics2/Graphics.hx#L36
https://github.com/hxDaedalus/hxDaedalus/blob/master/src/wings/luxe/SimpleDrawingContext.hx#L158
https://github.com/hxDaedalus/hxDaedalus/blob/master/src/wings/flambe/GraphicsComponent.hx#L212
perhaps you could adapt
https://github.com/hxDaedalus/hxDaedalus/blob/master/src/wings/pixel/PixelTriangle.hx#L88

You can fill shapes by triangulation or use something like Flump to export nested png structures.
https://github.com/nerik/poly2trihx  - done some experiments in Kha this can do a good framerate also have some Kha 2d in 3d drawing code around somewhere.
https://github.com/tconkling/flump/wiki
https://github.com/SavedByZero/openflump

For webgl you can also adapt this approach it's not very fast but you would only have to render off the fonts at the size you needed to an image, although I used serializeXML with dynamically generated svg have a demo around which also experimenting with filters to enhance the sharpness, but concept here
https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Drawing_DOM_objects_into_a_canvas

Not really looked at heaps but seem to remember it uses a poly2trihx type approach, I think there is a luxe tiny svg library in the works but can't seem to find it right now.

Heaps can use lime c++ so perhaps you can use the svg/swf openfl/nme libraries.

There are probably lots of Haxe cross target approaches, but AIR is still quite a good tool with it's vector and video support, but no reason not to target it from Haxe, There is openfl starling and away3d so you can get all your logic in haxe and look to move away from a vector centric approach prior to luxe heaps or kha.

Best

Justin

Thomas John

unread,
Nov 14, 2016, 1:19:15 PM11/14/16
to haxe...@googlegroups.com, tar...@touchmypixel.com
wow thanks for all of this.
I already had a look at many of them.
As for now, I still find AIR more appealing. I need to target mobiles as well and it's much, much easier to be able to build from a single machine, with a single tool.

You're totally right, there is no reason not to use haxe. It just takes a long long time to convert all of my code base into haxe.

Thanks again for all of this !

--
You received this message because you are subscribed to a topic in the Google Groups "Haxe" group.

For more options, visit https://groups.google.com/d/optout.



--
Thomas John

Hudson Ansley

unread,
Nov 23, 2016, 11:02:28 AM11/23/16
to haxe...@googlegroups.com, JLM
Great info, thanks Justin

--
Reply all
Reply to author
Forward
0 new messages