[ Home ]

Library Documentation (v 0.13.0)

Core

Advanced functions to change how your program runs.
Core.version:String
Get the current version of Haxegon. Haxegon and its extensions use Sematic Versioning: https://semver.org/
Core.fps:Int
Change the game's framerate.
Core.time:Float
is equal to the number of seconds passed since the game started.
Core.imagesmoothing :Bool
Set to true uses bilinear smoothing when displaying images. Set to false by default.
Core.enablescreen :Bool
Advanced. Set to true to disable the Haxegon screen completely. This is useful if you just want to use Starling display objects directly!
Core.showstats:Bool
Set to true to show stats like framerate.
Core.delaycall(f:Function, t:Float)
Tells Haxegon to call this function after "t" seconds have passed.
Core.quit()
Native targets only. Closes the application.
Core.mobilebrowser():Bool
Works on HTML5 target only (returns false on other targets). Returns true if the user is viewing the app in a mobile browser (like iPhone Safari).
Core.window:Window
Native targets only. Gives you access to the native window object. See OpenFL documentation for more information.
Core.fullscreenbutton(x:Float, y:Float, width:Float, height:Float)
For security reasons, most browsers will not allow your application to enter fullscreen mode unless the change is triggered as a result of a mouse click (in a specific, low level way). This function designates a rectange on the screen that, when clicked, will toggle fullscreen mode. It is up to you to draw something on the screen that looks like a fullscreen button below this!
import haxegon.*;

class Main {
 public function init(){
    Core.fullscreenbutton(0, 0, Gfx.screenwidth, Gfx.screenheight);
 }
 
 public function update() {
  Gfx.drawbox(5, 5, Gfx.screenwidth - 5, Gfx.screenheight - 5, Col.WHITE);
  
  Text.size = 3;
  Text.display(Text.CENTER, Text.CENTER, "Click anywhere to toggle fullscreen");
 }
}