13 2 / 2012

Looking to move from Flash to WebGL? IvanK brings the Flash API to JavaScript

Ivan Kuckir sent in a neat library to help Flash developers move to JavaScript.

I have made a graphics library to help people move from Flash to Javascript.  It is something like EaselJS, but unlike EaselJS, all the classes, methods and properties come from Flash and unlike EaselJS, it uses WebGL (GPU) for drawing graphics (it is fast). 

As he says, the API is heavily based on Flash so it will be very familiar to Flash developers.  The library supports many common things, including a scene graph for mouse events over individual elements (not possible with plain WebGL without lots of work), text rendering, images, vectors and more.  It’s all 2d at the moment but rendered on WebGL for speed.  Perhaps it needs a 2d canvas fallback for IE9 though…  The library touts its speed and mobile device support - things most Flash based apps can’t.

There are some library demos, but Ivan has gone even farther and made two fun games with it that certainly show the library’s power and performance.  The first is “Crazy Bugs”, and it is a game where you must move a virtual net around to prevent the bugs from crossing paths.  The second is called “Big Fish” and in this game you are a fish and you have to eat the smaller fish and avoid the bigger fish.  Both are worth a play!

While the library is heavily based on Flash and he says Flash developers will have no trouble picking it up, it does have some documentation of its own for you to get started, and of course the demo source code.  If you’re a Flash developer looking to move to HTML5, this library is certainly worth a look!