@TerryCavanagh TerryCavanagh released this Jan 21, 2017 · 263 commits to master since this release

Assets 3

Note: The recommended way to use Haxegon is to install it via haxelib:

haxelib install haxegon

0.6.0 (2017-01-21)

New features

  • Added a new example game to the haxegon-samples repo: Tiny Heist.
  • Haxegon now uses Starling's QuadBatches internally, which speeds up drawing of primitives in many cases, especially HTML5.
  • A number of surface drawing functions have been implemented:
  //Grab an image from the screen
  Gfx.grabimagefromscreen(imagename, screenx, screeny);

  //Grab a tile from the screen
  Gfx.grabtilefromscreen(tilesetname, tilenumber, screenx, screeny);

  //Grab an image from an image
  Gfx.grabimagefromimage(destinationimage, sourceimage, sourceimagex, sourceimagey);

  //Grab a tile from an image
  Gfx.grabtilefromimage(tilesetname, tilenumber, imagename, imagex, imagey);

  //Copy a tile from one tileset to another
  Gfx.copytile(totileset, totilenumber, fromtileset, fromtilenumber);
  • The new save functions from the last version have been moved to Save.hx. Some functions have been renamed, and some new functions have been added:
  //Loading and saving values:
  Save.savevalue(key, value);             //e.g. Save.savevalue("highscore", highscore);
  Save.loadvalue(key);                    //e.g. highscore = Save.loadvalue("highscore");
  Save.exists(key);                       //e.g. if(!Save.exists("highscore")) highscore = 0;

  //Changing or deleting the save files
  Save.fileexists(filename:String);       //Returns true if this file exists (i.e. it has at least one key saved)
  Save.filename = "mygame_slot1";         //Sets a name for your savefile (optional! default is "haxegongame".)
  Save.delete(filename:String);           //Delete a save file (leaving parameter blank deletes the default)
  • Save.keys is an array of strings containing all the saved keys for the current savefile. An example usage:
  for(i in 0 ... Save.keys.length){
    trace(Save.keys[i] + ": " + Save.loadvalue(Save.keys[i]));
  }
  • Added Core.window, for native targets only. Allows you to control parameters of the current application window. See OpenFL documentation for more information.
  • Added Core.quit(), for native targets only. Quits the application.

Bug fixes/Tweaks

  • Fixed a bug where Gfx.drawtoimage() and Gfx.drawtotile() didn't work if called in Main.new().
  • Default value for Save.loadvalue(key) is always 0 - it no longer logs a warning.
  • Implemented Text.wordwrap as a variable instead of a function.
  • Fixed Core.callafterupdate(f:Function).