[back to index]

Library Reference (v 0.9.0)

Scene

Scene management and control!

A Scene in Haxegon is a class with an update() function, and optionally with the following functions:
new() (called when you first change to this scene)
reset() (called every time your change to this scene)
render() (for optionally seperating your logic and drawing code)

The default Scene when your program starts is Main, but you can change this with the Scene.change() function.
Scene.change(newscene:Class)
Change the game's current scene.
Scene.name(requiredscene:Class):Class
Returns the name of a scene as a String.
Scene.get(requiredscene:Class):Class
Advanced! Returns an instance of the required scene. Can be used to access that Scene's member variables, though alternatively you could just make that scene's functions static.