If you paid attention during the post-GDC news, you probably heard that Epic Games and Mozilla teamed up to get the Unreal Engine running in the browser, without plugins, in a matter of four days. The secret? Emscripten.
Alon Zakai has worked three years on Emscripten, and its an amazing piece of software.
This morning, I decided to fork BunnyMark to find how each of the NME rendering methods compare to one another.
I was surprised by the results. I suspect that some of these tests can be improved, so feel free to send pull requests. Continue reading NME Rendering Methods (Benchmarked)
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
There has been a good amount of discussion recently about concurrency (multi-threading), now that Actionscript has added support in the new Flash Player release.
Haxe already supports threading when you are using the C++ or Neko targets.
The following samples will not work for Flash or HTML5, but will create and manage communication between threads on the Windows, Mac, Linux, iOS, Android, BlackBerry and webOS targets for NME.
Continue reading Using Threads with NME
I am one of the lead developers for NME, a cross-platform, open-source framework.
The BlackBerry target is the newest platform we support. It took me less than two days to add. Continue reading Adding the BlackBerry C/C++ Native Target in 48 Hours
If you have not done so already, follow this post to install Haxe, NME and MonoDevelop.
If you would like to make a visual application, NME provides an array of features beyond the standard Haxe/C++ toolset. NME uses OpenGL, Freetype, libpng, libjpeg, cURL, SDL and other libraries to provide a Flash-similar API for C++ targets. NME is also designed to build applications for Flash and is compatible with Jeash, a library for HTML5 applications.
We can create a new application by going to File > New > Solution in MonoDevelop.
Now we are ready to write some code. Unlike a traditional Haxe/C++ project, the NME template extends the “nme.display.Sprite” class, which is similar to the Sprite class in Flash. We can begin by adding a simple shape, similar to how we would draw a rectangle in Flash: Continue reading Getting Started with Haxe/C++ and NME in MonoDevelop
If you have not already, follow this post to install Haxe and MonoDevelop on your system.
To begin a new Haxe/C++ project, open MonoDevelop then go to File > New > Solution
You can select the “Empty Haxe/C++ Project” template, and enter a name and location for your new project. Continue reading Getting Started with Haxe/C++ in MonoDevelop
One of the things that I love about NME is that it is easy to extend. Unfortunately, there is not much documentation on the subject, so I want to take a few minutes to help describe what you can do with an NME extension, and how to create one. Trust me, it is not difficult.
Beginning with NME 3.2, all you need to make an extension is add a file called “include.nmml.” This file is processed just like an ordinary NMML project file, with the exception that paths are relative to where your extension is located.
For example, in the “Test” extension I have created, this is my “include.nmml” file:
<?xml version="1.0" encoding="utf-8"?>
<ndll name="test" />
<java path="project/android" />
You could include assets, defines, haxelib dependencies, NDLL references, Java code… practically anything you can define from an ordinary NMML project file for NME, you can define using your extension. Continue reading How to Create an NME Extension
The latest SWF embedding support in NME makes it that much easier to recreate (or create!) your favorite meme:
var cat = new NyanCatAnimation ();
var theme = Assets.getSound ("assets/Nyan Cat Theme.mp3");
theme.play (0, -1);
When you mark a symbol in Flash to “Export for ActionScript”, you can choose a class name. In the example above, my MovieClip was exported using “NyanCatAnimation” as the class name. Continue reading Embedding SWFs Makes NME Meme-Friendly
I have been going through code library to find more tools I could bring to Haxe. I am happy to share some new libraries, as well as a few old ones, which may be helpful in your next (or current) NME (or Haxe) project.
If you have used NME before, you probably have heard of Actuate. Simply put, Actuate is a “tween” library, designed to automatically transition objects from one value to another. This works for animation, of course, but is also useful for fading sound, adjusting filters or setting a quick timer.
Two years ago, Actuate was my bread-and-butter library, like (I would argue) tween libraries should be for a Flash developer. It was the culmination of using many kinds of libraries in the best, and actually performed faster than GreenSock’s TweenMax and TweenLite libraries by a fair margin. Most of all, I made sure to give Actuate a “set it and forget it” reliability I had come to appreciate from using Zeh Fernando’s famed Tweener library. Continue reading 7 Useful Utilities For Your Next NME Application