flixel-gdx 0.6 released!

It’s been a while since we did a release. To be precise the last release was in October ’12. The reason for this delay is we were implementing so many other things that weren’t planned in this release and the most users were using the nightlies (which is very stable) via the setup tool. Anyway 0.6 is now released and you might think, “What?! 0.6, I thought it was 2.56” and “Shouldn’t it at least be 1.0 or higher?!”. Uhmm yeah…we never mentioned what the current version of flixel-gdx is. In the class FlxG and window title you see flixel-gdx v2.56. This number is based on the version of Flixel Community. Since we got the nightly build and we didn’t do any stable release users might be confused what version they actually were using. About 0.6, the previous release was flixel-android 0.5 hosted at Google Code. We simply bumped a digit up and we never thought about making it 1.0. But let’s have a look at the noticeable changes we made.

HTML5 support

This has been on our list for some time. This wasn’t an easy one to get it done. After we got the libgdx’s Reflection API implemented there were still a lot of bugs that needs to be iron out. Finally the most demos working fine and it can be seen on this page. This platform uses GWT which can be a frustration to get things working and the performance is not better than the standard JS implementation.

iOS support

Libgdx uses RoboVM as the official iOS solution. Previously they used Xamarin, but it got bugged by each new release of Xamarin and the performance wasn’t great either. Many developers have already released their games via RoboVM. For flixel, we only created the project files and tested it on a borrowed Mac Mini. It has been tested on a real device and it runs superb. Currently it’s not added in the build.xml, so there will be no jars generated. You can find more info about this over here.

Flash replicas

If you’ve been using the nightlies you’ve seen there is a flash package. This contains replicas of Flash’s classes. We have moved the most libgdx references from the core and it looks much cleaner.

OpenGL ES 2.0 support

GLES20 could be turned on in the config, but it was never utilized in the engine unless you want do textures with the size that is not power by 2. After implementing GLES20 a new door opens. You can do a lot more now which couldn’t be done with the fixed pipeline of GLES10. We now support shaders, a lot of new blend modes and distance field font.

Other noticeable changes

Bug fixes and improvements

Of course we also fixed a lot bugs, improved existing API and added a lot of new features. Here’s the full change log, which you can also view it in our repository.

The download page got a stable release which contains the flixel-gdx jars, universal tween engine and the libgdx nightly that was used. If you prefer the source there is a tag release made at GitHub.

Remove OpenGL ES 1.0

Libgdx has decided to drop OpenGL ES 1.0. We will remove any references of GLES10 in flixel-gdx after this release. If you are using GLES10 in your project, you might want to try to upgrade or stay at this stable release. This will be our last stable release with GLES10 and there will be no further support for GLES10 from now on.

In this release there is a bug that hasn’t been fixed. It‘s about multiple camera. As far as we know it only happens on Android. The bug occurs when you resume your game (if you minimized your game and come back again). The glScissor (which does the clipping) stops working the graphics will go out of the bound. This has been fixed in some later nightlies of libgdx, but the GLES10 was already removed. If you are planning to use multiple cameras, you should update your project once we update to the latest libgdx nightly.

What will you benefit from GLES20 you may wonder, nothing big actually, unless you want to work with shaders. For us, the API will be simplified (the GL10 references will be removed). There will be a blog post once this is done.

Future plans for 0.7

I got some plans that I’d like to work on for the next release. You see this list, it’s from FlixelCommunity. I’m part of it and I’ve to work on that as well. It will have benefits for flixel-gdx and there are more developers working on the same thing. Anyway, here is a list of features I’d like to see in the next release:

I’ve no date settled to start working on any of these. I got a new job which is 133 km from my home. I’ve decided to move to a friend for a couple of months. I will have to leave my PC behind. It means I can’t work on new features, but I’ll try to fix bugs when they are reported.

See you next time.

Posted in flixel-gdxLeave a comment

Distance Field Font

FlxText uses Freetype to generate bitmap fonts for desktop and Android and for HTML5 you need a tool to generate a bitmap font. These traditional bitmapfont looks fine when they are 1:1 on screen, but they look bad when they are scaled or rotated. The distance field solves this problem. With this you can render crisp text even if it is scale very large, rotated or other transforms. There are benefits using distance field over Freetype and traditional bitmap fonts.

Traditional Bitmap font
– For each font size you need to generate a bitmap font.
– Depending on how many BitmapFont files you use, it can eat the free space on the device and multiple texture atlases can affect the performance.
– Loses quality when scaled, rotated or transformed.

Freetype font
+ Freetype generates bitmap fonts on the fly.
– Too big size can lead to a crash and generating bitmap fonts takes some time on mobile devices.
– At the time of writing Freetype generates a single atlas page for each BitmapFont. Multiple texture atlases can affect the performance.
– Depending on how many TTF files you use, it can eat the free space on the device.
– Loses quality when scaled, rotated or transformed.

Distance Field Font
+ Only needs one bitmap font for all sizes.
+ Keeps quality when scaled, rotated or transformed.

I only implemented for GLES20 support. It is possible to support GLES10 as well, but the rendering wasn’t quite the same and you can’t adjust the smoothness. Also libgdx consider to drop GLES10 and judging from the comments the chances are high it will happen.

Check the wiki for the howto.
Want to read more stuff? Here is a paper.

Take a look at the screenshot to see the differences:
Distance Field Font

Posted in flixel-gdxLeave a comment

flixel-gdx and iOS

After HTML5 support, I borrowed a Mac Mini from late 2009. It’s not a fast Mac Mini (2.26 GHz and 2 GB DDR3), but the most important part; it meets the requirements to develop iOS app.


Libgdx framework uses RoboVM backend for iOS development. RoboVM translates Java bytecode into native ARM or x86 code. The runtime code is licensed under Apache License v2.0 and the compile time tools under GPLv2. You can do pretty much in the commercial projects. The current version is 0.0.9 and it still in the early stage. However there are already games compiled with RoboVM at the App Store.

If you think RoboVM is cool and planning to use it in your project, consider sponsoring.

I created flixel-robovm and flixel-examples-robovm projects. The first project only contains the libraries which your project will link to it. The other project is just a starter for the demos in iOS. I’ve only ran some demos in the iOS Simulator, because I do not own a real iOS device. However they did run pretty nice. I tested Mode, Animation, TiledMap2 and FlxCollisions.

Mode iOS


If you want to try flixel-robovm, you need to meet the requirements:

  • A Mac with at least Mountain Lion.
  • A developer certificate from Apple if you want to test on a device. This cost you $99 / year. Blame Apple.
  • You need to install Xcode 5.0.1 or higher.
  • RoboVM for Eclipse plugin. Get started with RoboVM.
  • Checkout the latest commit of flixel-gdx and flixel-gdx-examples.
  • Import flixel-robovm and flixel-examples-robovm.
  • You’ll get some errors, because the libraries are missing. Do an ant –f fetch.xml in the Terminal. It’s located at flixel-gdx/fetch.xml.


To run on the simulator, right click the flixel-examples-robovm project and select Run As -> iOS Simulator App. The compiling takes a while for the first time. The next time you compile, it will only look at the changes and this will speed up the compile time. To run on the device, select Run As -> iOS Device App.

To change the demo, create or copy an existing class from the flixel-examples-robovm and change the code to target the demo you want to run. You also need to edit robovm.properties file which can be found in flixel-gdx-examples, but that is easily done.

We need your help

As previously described, I only tested on the iOS Simulator. If you own an iOS device and an Apple Developer account, please help us testing the demos on a real device.


Fernando, a developer from FlixelCommunity, tested on his iPad (4th generation). It runs very smooth. He made a video for us:

Posted in flixel-gdx, iOS, RoboVMLeave a comment