It's in charge of calling the update functions of NBase's classes and instances and contains some useful functions.

Available since

0.1.0

.

Static variables

@:value(null)staticread onlyapp:App = null

The associated hxd.App instance.

@:value([])staticcreatedScenes:Array<Scene> = []

All nb.Scenes instances active.

@:value(null)staticread onlycurrentScene:Scene = null

The current/main scene.

@:value(null)staticread onlycurrentSceneName:String = null

The current/main scene name.

@:value(false)staticlogging:Bool = false

Whether this class should use traces. true by default if compiler flag debug is defined.

@:value(null)staticread onlymainCamera:Camera = null

The scene's main camera.

@:value([])staticfinalread onlynbObjects:Array<Object> = []

All nb.Objects instances active.

staticneroFS:NFileSystem

A shortcut to the nb.fs.NFileSystem made at the start of the application.

@:value(0)staticnextFrames:Int = 0

If pause is set to true, classes and instances will still be updated for this amount of frames.

@:value(false)staticpause:Bool = false

If true, most classes and instances won't be updated.

@:value(Macros.makeScenes())staticfinalread onlysceneClasses:{firstscene:FirstScene>} = Macros.makeScenes()

All nb.Scenes classes in the project's "src/scenes" folder.

@:value([])staticfinalread onlyscenes:Map<String, Scene> = []

Contains all the scenes active, mapped to their name at creation.

@:value(1)staticspeed:Float = 1

Time elapsed modifier. At 0.5, dt is halved.

@:value(null)staticread onlywindowSize:{w:Int, h:Int} = null

The window size.

Static methods

@:value({ pos : -1 })staticaddInteractiveUpdate(i:Interactive, pos:Int = -1):Void

Adds an nb.Interactive instance to the update queue.

@:value({ force : false, pos : -1 })staticaddObjectUpdate(obj:Object, pos:Int = -1, force:Bool = false):Void

Adds an nb.Object instance to the update queue.

@:value({ pos : -1 })staticaddSceneUpdate(s:Scene, pos:Int = -1):Void

Adds an nb.Scene instance to the update queue.

@:value({ disposeScene : false })staticchangeScene(name:String, disposeScene:Bool = false):Scene

Changes the displayed scene.

Parameters:

name

Unique name of the scene to be displayed, the one given at creation.

disposeScene

Whether the current scene displayed should be disposed.

Returns:

The newly displayed nb.Scene instance. If null no scene change was made.

@:value({ name : "unnamed" })staticcreateScene(sceneClass:Class<Scene>, name:String = "unnamed", ?args:Array<Dynamic>):Scene

Creates a scene.

Parameters:

sceneClass

The class of the nb.Scene to create.

name

A unique name the nb.Scene instance will be mapped to in scenes. It is different from the nb.Scene's object name which doesn't have to be unique.

args

Parameters to pass to the nb.Scene instance at creation.

Returns:

The created nb.Scene instance.

@:value({ global : false })staticgetMouseCoords(global:Bool = false, ?scene:Scene):Point

Returns the mouse coordinates on the scene.

@:value({ h : 300, w : 300 })staticinit(app:App, w:Int = 300, h:Int = 300, onFinished:() ‑> Void):Void

Initializes this class. It needs to be done once before being used and have neroFS set.

staticremoveObjectUpdate(obj:Object):Void

Removes an nb.Object instance from the update queue.

staticresetScene():Void

Recreates the current scene and switches to it, disposing the old one.

staticupdate(dt:Float):Void

The function that updates everything.