Actuate: Now with Bezier Tweens (Again)

Anyone who used the old Actionscript version of Actuate may know there used to be a “motion path” tween. In the translation to Haxe, this is something I never ported.

I am happy to announce that Actuate 1.50 has just been released on haxelib, including a new and improved version of the motion path tween! Continue reading Actuate: Now with Bezier Tweens (Again)

HTML5 Benchmark Scores: NME RunnerMark

If you are on Twitter, you may have seen links to RunnerMark, a benchmark that tests rendering performance of Adobe AIR and NME.

We have been improving the performance in the (beta) HTML5 target for NME, so I am happy to share some of the results. These improvements will be released with the next version of NME. Continue reading HTML5 Benchmark Scores: NME RunnerMark

Using the Remote Control Library with NME

Yesterday we published an NME native extension called “remote-control”

This makes it really simple to add Apple Remote support to your NME games or applications. To install, open a terminal or command-prompt and run “haxelib install remote-control”. To add it to a project, open the NMML file and add <haxelib name=”remote-control” />

Then it is only a few lines of code to begin listening for remote control events. Here is a complete example:  Continue reading Using the Remote Control Library with NME

Adding Inline C++ to Haxe Code

On the NME forums this morning, redannick asked if it was possible to get the current timezone offset, using Haxe.

Unfortunately, I discovered that getTimezoneOffset() is not part of the Haxe Date class. Perhaps this will be available in Haxe 3. For the meantime, I found a solution using the @:headerCode and @:functionCode tags.

This was my first experience using compiler metadata tags for C++. This is really powerful. Continue reading Adding Inline C++ to Haxe Code

Changing the Flash API (We Have the Technology)

I came across a devious discovery.

I found that I can change the Flash API.

Conditional compilation and typedefs are two features which are available in Haxe, but not in Actionscript 3. NME uses these features to alias “nme.display.Sprite” and other classes to “flash.display.Sprite” and our backend classes for the native and browser targets.

This is powerful for implementing a unified API across multiple platforms, but because we do not control Flash Player, we have not been able to fiddle with the definition of “flash.display.Sprite” … until now. Continue reading Changing the Flash API (We Have the Technology)

Go from Flash to NME in 5 Minutes

A week ago, Emanuele Feronato posted his Toony Flash game prototype, showing off a simple prototype that recreates the core gameplay from the online matching game, Toony.

Emanuele mentioned that he “would love to see it ported to mobile device,”  so sure enough someone ported it the next day to run on iOS, using Corona.

Not to be out-done, Julian Liebl from Northlight Games brought the game to Haxe, running it on multiple platforms using NME.

Unlike Corona, NME is free, open-source, and targets iOS, Android, BlackBerry, webOS, Windows, Mac, Linux, Flash and even HTML5 from the same codebase.

I loved seeing Julian’s version, but I couldn’t help but wonder if we could bring the game over to NME using even fewer changes to Emanuele’s original. Continue reading Go from Flash to NME in 5 Minutes

Getting Started with Haxe/JS in MonoDevelop

If you have not done it already, go to this post and install Haxe and MonoDevelop on your system.

It is easy to start writing haxe JS using MonoDevelop. Create a new solution by going to File > New > Solution in the menu.

Let’s start with something simple:

js.Lib.alert ("Hello World");

This will display a Javascript alert. Although this is slightly more verbose than a traditional alert, you may notice code completion can speed things up. Having a clean API, and not having to keep it memorized is a huge benefit. This style of code completion will work even for your own code you write. It is even possible to receive code completion for existing Javascript libraries, like jQuery or Sencha Touch. Continue reading Getting Started with Haxe/JS in MonoDevelop

Getting Started with Haxe/Flash in MonoDevelop

If you have not installed Haxe and MonoDevelop yet, go to this post to read the easy instructions.

You can make a new Haxe/Flash project in MonoDevelop by going to File > New > Solution from the menu.

Now that we have a new project, let’s try drawing a shape:

graphics.beginFill (0xFF0000);
graphics.drawRect (0, 0, 100, 100);

With the code in place, use Project > Run from the menu, Ctrl+F5 (Command+Alt+Enter on a Mac) on the keyboard. Continue reading Getting Started with Haxe/Flash in MonoDevelop