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)
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)
If you are interested in testing a Flash application while you are running Linux, you will want to install a standalone version of Flash Player.
Unfortunately, installing the Flash Player Debugger and associating it with your SWF files can be tough to figure out, so I have written a script that will download, extract and associate the standalone Flash Player for you 🙂 Continue reading How to Install the Standalone Flash Player on Linux
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.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
If you need to create an application, Enyo is a choice you may want to consider. You can learn more at enyojs.com, and if you are a fan of Haxe-based development, there are externs for Enyo 1.0 on haxelib which can enable you to use the framework while also benefiting from the many advantages of haxe JS.
Although most of the samples for Enyo are applications, at least one sample, “Pirate Pig,” is that of a game. It is a quirky game that uses similar mechanics to Bejeweled. You can view the original version here:
In the spirit of a game jam, I wanted to create the game in two days. In the interest of supporting my wife, I wanted to also keep it during the day instead of working late. Continue reading NME Game Example: “Pirate Pig”
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
Hugh Sanderson made some amazing SWF parsing code in the GM2D game library. When he isn’t making NME awesome, he is improving HXCPP, GM2D, or enjoying well-earned time with his family.
I used his SWF parsing code for the first time last week. Since that time, I have merged the code into NME and have begun the process to find any areas where it can improve and where it can shine even brighter.
I am very excited about what this will mean for NME. Sprite sheets will always be one of the fastest ways to render, but SWF support will mean sprite sheets are an option, not a requirement when creating animation for NME. You could even load a SWF and generate a sprite sheet at runtime, or we could build a cross-platform tool in NME that could import SWF files and help create layouts and optimized graphic assets.
Bottom-line: The ability to load SWF files at runtime in NME, whether you publish to Flash or C++, eliminates one of the long-standing “trade-offs” to using NME to create games or applications. Continue reading Use SWF Assets in NME — Cross-Platform!
From the beginning, Haxe was created to be a “multi-platform programming language.”
For everyone who is excited by HTML5, you can now publish to Flash, C++ and Canvas as easy as…
haxelib run nme test MyProject.nmml flash
haxelib run nme test MyProject.nmml ios -simulator
haxelib run nme test MyProject.nmml webos
haxelib run nme test MyProject.nmml android
haxelib run nme test MyProject.nmml cpp
haxelib run nme test MyProject.nmml cpp -64
haxelib run nme test MyProject.nmml html5
Here is my previous “Actuate Example,” running in Flash and in Canvas as a comparison:
A few months ago, a friend recommended that I try BunnyMark, a cute rendering benchmark. I have meant to port it to Haxe so I could use it to benchmark NME, so today I decided to give it a whirl.
The first two tests were performed on my laptop, using Flash Player and a compiled Windows application, using NME. The first test uses separate bitmap objects for each of the bunnies, so rendering performance relies more heavily on the display list.
Continue reading Benchmarking NME with BunnyMark