Note: The recommended way to use Haxegon is to install it via haxelib:
haxelib install haxegon
Migrating to 0.12.0 from older versions of Haxegon
This update was focused on making some final calls about the structure of the library. From here on out, you can expect Haxegon’s API to stay pretty stable!
Here are the main things you’ll need to change to migrate to 0.12.0:
- Download the new blankproject.zip file, and copy your project source and data files into the new folder. This should hopefully be the last time the project file changes. Make sure you have a plugin/ folder after you do this!
Text.alignis now a variable instead of a function, so change
Text.align = Text.CENTER.
Sound.play()has been moved, so you should check that you have the parameters in the right order.
- Haxegon now supports a plugin system, inspired by OpenFrameworks! Plugins allow you to expand the funtionality of Haxegon. There are three available right now (keep an eye on http://www.haxegon.com/plugins/ for an up to date list.) The three initial plugins:
- The blankproject.zip file has been updated again, hopefully for the last time! Updating blankproject.zip to the latest version is required to support plugins.
- Haxegon is now an organisation on github! See http://github.com/haxegon/ for all related Haxegon plugins and projects.
- Haxegon is now licenced under the MIT licence.
- Haxegon now uses .mp3 files for all browsers in HTML5. .ogg files are no longer required for HTML builds (though they’re still required for Native builds for the time being). Alternatively, .wav files work on all platforms.
- Haxegon can now read JSON and XML files! They’re loaded from the data/text/ directory, same as TXT and CSV files. Check out the new JSON and XML parsing to see how to parse them.
Text.alignis now a variable instead of a function. Instead of
Text.align(Text.CENTER), you type
Text.align = Text.CENTER. (This means it’s now possible to check the current Text alignment.)
- You can read all inputted keys from the new
Text.inputbufferString. This is basically a low level version of the
Text.input()system for if you want to do something fancy.
Gfx.keeppixelratio. As a replacement,
Gfx.resizescreen(w, h)has been changed to
Gfx.resizescreen(w, h[, keeppixelratio]).
Gfx.onwindowresized(), which is
truewhen the window has been resized this frame.
- Haxegon’s random number generator has been replaced with an implementation of Xorshift, which should mean that it gives better results than the old system, and gives predictible results for any given seed on every target platform.
- You can now use string based seeds for
Random.seed, in addition to numbers. e.g.
Random.seed = "winter",
Random.seed = 1234;both work.
- Added a new function,
Random.weighted([options], [odds])- inspired by chance.js.
offsettimeas a variable from
volumeas a parameter to
- Added all previous haxe
Geom. They’re exactly the same, except they use degrees instead of radians. Haxegon now uses degrees everywhere. (e.g. You can call
Filtersclass has been removed.
Filtersis now a plugin, and has several new settings: https://github.com/haxegon/plugin_filters
- Fixed a bug where
Convert.toint()could give an incorrect value for large negative numbers.
- Fixed a situational crash bug with changing
- Fixed a crash bug where Haxegon would crash on some platforms if
Gfx.drawtile()draw an image or tile that doesn’t exist.
- Fixed a bug with
- Fixed a crash bug on HTML5 when trying to display arrays with
- Haxegon now releases all keypresses when it loses focus (thanks @randomnine)
- Removed the old Ctrl + Click behavior for Flash to simulate a right click.
- Haxegon uses “top left” as the default pivot point for all scales and rotations now.
Scene.get(). It encouraged bad behaviour that probably doesn’t reliably work anyway (i.e. non static scene classes).
Scene.name. (same reason)