12/10/2015

FlxSnippet: Change font in all FlxText at once

Here’s a nice block of code to change the font for all the FlxText in a group / state, instead of manually calling setFormat on each one. ForEach exposes FlxBasic objects, but once we make sure the current iterable is a FlxText we can safely cast it and do our deed! Make sure to call before changing the alignment as setFormat will change it back to its default value. Tested in Haxeflixel 4.0
this.forEach(function(member)
{
    if (Std.is(member, FlxText))
        cast(member, FlxText).setFormat(AssetPaths.YOUR_FONT__TTF);
}, true);

16/08/2015

HaxeFlixel Random Dungeon Generator

I was playing around with the idea of making a roguelike in HaxeFlixel, surprisingly I didn't find many of those around. I ported Julsam's haxe dungeon builder, right now it's a pretty basic implementation (no player), but it's a start.