Migrating to Flambe 3 - aduros/flambe GitHub Wiki

Haxe 3

Flambe 3 and onward requires Haxe 3. Haxe 3 comes with several useful new features, but also some breaking changes from 2.x. Luckily, handling those changes is easy.

  • Review the Haxe 3 migration guide.
  • Consider using the convert-haxe3 script to automatically perform the gruntwork renaming (eg, Hash<Foo>Map<String,Foo>)

WebGL

Flambe's WebGL renderer is out of beta and has been enabled by default. All you need to do is recompile your project to get better performance with WebGL. Browsers without WebGL will fallback seamlessly to canvas.

There are some minor differences between the canvas and WebGL renderers you should know:

  • The canvas renderer snaps to the nearest whole pixel when drawing, for performance. The WebGL renderer does not, which means smoother animation, but sprites positioned on subpixels will be aliased slightly.
  • The WebGL renderer doesn't perform mipmapping at the moment, so large images that are scaled down may appear aliased.

If you want to disable the WebGL renderer and always use canvas, pass the flags -D flambe_disable_webgl in your wscript like this:

    ctx(features="flambe", platforms="html",
        flags="-D flambe_disable_webgl")

(You can even pass flambe_disable_canvas, if you want to save a few bytes and you're running in a controlled environment that you know supports WebGL)

As always, please report any rendering bugs so they can be quickly fixed!

Flambe API changes

Very minor: I moved all the subsystem classes that are accessed via System into a single package. Unless you were manually importing them, you shouldn't need to make any changes. Those changes are automatically performed by the convert-haxe3 script above.

⚠️ **GitHub.com Fallback** ⚠️