Loads a scene from XML file. Scenes contain layers of entities (custom FlxSprite), backgrounds, tilemaps, constants, UI and more.

Any questions tweet me @AndreiRegiani

Constructor

new(?file:String)

Optionally set the scene file already.

Parameters:

file

Location of XML.

Variables

@:value("assets/")assetsDirectory:String = "assets/"

Base directory for all assets loaded inside FlxScene.

read onlydescription:String

attribute.

read onlyheight:Int

attribute.

read onlyname:String

attribute.

tilemap:FlxTilemap

Tilemap reference.

read onlyversion:String

attribute.

read onlywidth:Int

attribute.

Methods

const(id:String):Dynamic

Gets a specific constant by ID.

Parameters:

id

Constant name.

Returns:

Bool, Int, Float or String associated with the ID.

loadBackgrounds(?container:FlxTypedGroup<Dynamic>):Void

Add backgrounds to state.

Parameters:

container

Add backgrounds to this FlxTypedGroup (layer).

loadEverything():Void

Add everything (backgrounds, tilemap and all objects) to the state.

loadTilemap(?container:FlxTypedGroup<Dynamic>):Void

Add tilemap to state.

Parameters:

container

Add tilemap to this FlxTypedGroup (layer).

object(id:String):Dynamic

Gets a specific object by ID.

Parameters:

id

Constant name.

Returns:

The object associated with the ID.

set(file:String):Void

Set the current scene, loads from XML file.

Parameters:

file

Location of XML.

spawn(?container:FlxTypedGroup<Dynamic>, ?layerId:String):Void

Instantiate objects to state.

Parameters:

container

Add objects to this FlxTypedGroup (layer).

layerId

Add objects only from this layer.