NBase's scene class. You should use this instead of h2d.Scene
s.
0.1.0
.Static variables
staticfinalread onlyonClickFs:Array<GlobalMouseEvent> = []
All nb.Scene.GlobalMouseEvent
instances that gets triggered by a mouse click.
staticfinalread onlyonPushFs:Array<GlobalMouseEvent> = []
All nb.Scene.GlobalMouseEvent
instances that gets triggered by pressing a mouse button.
staticfinalread onlyonReleaseFs:Array<GlobalMouseEvent> = []
All nb.Scene.GlobalMouseEvent
instances that gets triggered by relasing a mouse button.
Static methods
staticaddOnClickF(f:() ‑> Void, priority:Int = 0, name:String = ""):Void
Creates an nb.Scene.GlobalMouseEvent
that gets triggered by a mouse click.
staticaddOnPushF(f:() ‑> Void, priority:Int = 0, name:String = ""):Void
Creates an nb.Scene.GlobalMouseEvent
that gets triggered by pressing a mouse button.
staticaddOnReleaseF(f:() ‑> Void, priority:Int = 0, name:String = ""):Void
Creates an nb.Scene.GlobalMouseEvent
that gets triggered by releasin a mouse button.
Constructor
Variables
read onlycanSeeScenes:Array<Scene> = []
Contains the nb.Scene
instances this scene can see through subscenes.
finalcontent:Object
A container.
By default, adding something to the scene will actually add it to this instead.
This is done so that if you want to apply an effect to the scene without affecting
the objects on the camera, you just have to add it to the scene's content
variable instead.
outside:Bool = false
When this is set to true
, the added objects becomes a direct children of this scene
instead of being added to content
.
read onlyrelSubScenes:Array<SubScene> = []
Contains all nb.SubScene
instances this scene is a parent of.
Methods
add(o:Object, index1:Int = -1, index2:Int = -1):Void
Use this function to add an object to the scene.
Parameters:
o | An |
---|---|
index1 | By default, |
index2 | This is only taken into account if |
checkInteractives(e:Event):Void
Triggers nb.Interactive
instances on the scene according to a given event.
mandatoryUpdate(dt:Float):Void
Same as the update
function but called first and used primarily for NBase's core logics.