open question regarding haxe and creative coding

217 views
Skip to first unread message

Lewis Lepton

unread,
Dec 12, 2015, 7:23:47 AM12/12/15
to Haxe
hello all,

this question has been somewhat annoying me since i cant seem to find anything. maybe ive been looking too much and cant find, or not enough. either way

i have been a big user of the really cool and awesome openFrameworks. if anyone has used it they should know what i mean. openframeworks.cc

but the problem, is that its c++ based. which isnt bad, but id like to shift this type of work and fun over to haxe instead.

is there any type of packages/libraries that could help in shifting it to haxe instead. to make haxe a creative coding platform. now that does sound strange since making coding is creative. but this is in terms of how openframeworks works and create awesome things.
openframeworks is a collection of many libraries/frameworks. you can make games, do interactives, handle video, handle camera input, etc etc etc. so its main central theme is creativity.

but on checking video input and handling is pretty bad with haxe. cant find anything that can play mp4. and even camera input. i have seen things like babylonhx and even away3d. but then those are just linked with games mainly. not to say i could not use them. but in terms of where i would like my code to reach, its pretty thin with these.
3d is obviously possible. but things like audio input are somewhat thin as well.

so any help that could... well... help would be greatfully thanked four

as said ive been a big user of openFrameworks, but c++ is not my main strong point and haxe in itself is damn easy to read from the get go and would love to extend using it by not just making games with openfl, but making it a creative coding platform i can be happy to continue using

many thanks

Creative Magic

unread,
Dec 13, 2015, 8:12:49 PM12/13/15
to Haxe
Some frameworks that I use ( with a bit of shameless self-advertising ):

* Nape (http://napephys.com/) - a 2d physics engine with one of the most beautiful API's 
* Actuate and XTeween - tweening libraries that can tween anything. XTween is supposed to be faster, but I haven't really done proper benchmark testing.
* OpenFL - (http://www.openfl.org/) Open Flash Library. If you've done any Flash programming (AS3) you'll be right at home. If not - still check it out, making creative apps or testing an idea won't be faster than a flash sketch. And yes, it's working on native targets - Android, iOS, OS X, Windows and [a lot] more!
* HaxeUI (http://haxeui.org/) - life's too short to write your own UI - use haxeui.
* Lime - it's the backend of OpenFL. If you want full control over your environment - pure lime coding is for you.

* ScreenManager (https://github.com/CreativeMagic/Screen-Manager) - a haxelib designed for OpenFL. If you want to remove all the boilerplate code of screen management - use this library.

Other than that you can always just search libraries over haxelib and see if you find that gem of a library you're looking for ;)

Atul Kumar

unread,
Dec 16, 2015, 5:38:08 AM12/16/15
to Haxe
I know many people nowadays dismiss right away what I am about to say: But have you consider to target the Flash Runtime? It's reputation is not that great anymore, but actually it ticks many, many boxes you'll need for "creative coding". It has great video file support, webcam, audio api, sockets, many libraries with native code bindings (ANEs, and u can create your own ANEs if something is missing), great cross platform support and much more. I know it is not bleeding edge performance, but with Stage3D it is much better than it use to be. And writing your code in Haxe makes it even faster.

In case of targeting Flash using a Haxe framework I find the following ones interesting:

I do not mention OpenFl, when targeting Flash since it does not make use of Stage3D and therefore no GPU rendering.

Another option could be to use https://processing.org. Not everybody knows this, but u do not really have to user their IDE. Basically the core of Processing is just a bunch of jar files. So theoretically u could just use Haxe to target java and link it with the processing jars. 

If u have to go native it gets much harder. I think u can say good bye to mp4 support then for example. As far as I know no framework provides decent video file support (I think NME has "some"support)  yet and I think it is hard to integrate natively. I think I read on twitter that the OpenFl team is working on that though.

If u would want to put in native video file support yourself I would probably take a look at ffplay.c and try to get that working with the Haxe SDL externs. But this would be a huge undertaking though, I guess.

Regarding audio apis when going native: probably u can use the linc library OpenAL instead of using whatever your chosen framework provides:

There is also a linc SDL library (for windowing, rendering, inputs, etc.), if u want to go more low level than using a full fledged framework.


In conclusion I think there are still many loose ends to tie, if u want to get a openFrameworks like feature set with Haxe.

I agree though that Haxe has a great potential to be awesome for that use case. Currently most people using "creative coding" frameworks are using c++ (openframeworks, cinder) or java (Processing). In the past Flash was used as well. While many game programmers seem to have switched from Flash to Haxe, it seems not to be true for the "creative coders". Currently main use case for Haxe seems to be games and web, and there are many competing technologies in that space. Not so much for the creative coding frameworks, so in my opinion Haxe would fit in there nicely and could become very popular with people who do not like c++. But unfortunately it is not there yet.

François Nicaise

unread,
Dec 16, 2015, 8:45:42 AM12/16/15
to haxe...@googlegroups.com
Hi Lewis,
A few years ago I had to do some serial communication and I wanted to switch from OpenFrameworks to Haxe just like you.
I found that Andy li provided a serial lib (actually a wrapper for ofSerial) (https://github.com/andyli/hxSerial) and NME + nape provided enough to make my project happen.
But I then needed bluetooth on linux as well. So I had to make some c++ low level code and wrap it to make it work on haxe.
Slightly off topic, on another project  I needed IAP in my android mobile app, so I hacked my way through java and wrapped it for haxe. Then when I wanted to play with Tokyo Tycoon, I did the same: write c++ and the wrappers. I have many other examples like this.
So I think everything is possible as long as you accept the fact that Haxe sits on top of other languages and that you may have to make some "low level" calls.

Now, I may have good news for you.
Being a daily javascript consumer (through haxe and scalajs), with an interest for gaming and hardware in a creative fashion, I don't think there's a lot missing in javascript to start your creative coding today.
There are many libs out there and you should easily find the one that fits your needs (and even maybe for video processing? https://github.com/addyosmani/getUserMedia.js/ ).
These libs may not be cross-browser. Usually it means that you will have to make your project work on chrome or maybe on firefox.
And If you intend to show you work, then maybe a nodewebkit app will allow you to do that?

Of course you may have to write wrappers for Haxe. But if your goal is to use the power of Haxe language for creative coding, then I think that's the fastest way to get started as soon as possible and create wonderful things...
( Which, of course, you will show us ;) )

++
François
--
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.

Reply all
Reply to author
Forward
0 new messages