ClassCore & Lifecycle@public
FlxState
Base game state; initialize state-owned objects in create.
ts
export declare class FlxState extends FlxGroupProperties
| Property | Modifiers | Type | Description |
|---|---|---|---|
destroySubStates | - | boolean | - |
persistentDraw | - | boolean | - |
persistentUpdate | - | boolean | - |
physicsWorld | readonly | FlxPhysicsWorld | null | Optional state-owned physics world, advanced after ordinary members. |
subState | - | FlxSubState | null | - |
subStateClosed | readonly | FlxSignal<FlxSubState> | Dispatched after the current substate has closed. |
subStateOpened | readonly | FlxSignal<FlxSubState> | Dispatched after a requested substate has opened. |
Methods
closeSubState()
ts
closeSubState(): voidReturns: void
create()
ts
create(): voidReturns: void
destroy()
ts
destroy(): voidReturns: void
draw()
ts
draw(): voidReturns: void
openSubState()
ts
openSubState(subState: FlxSubState): voidParameters:
| Parameter | Type | Description |
|---|---|---|
subState | FlxSubState | - |
Returns: void
removePhysicsWorld()
ts
removePhysicsWorld(destroy?: boolean): FlxPhysicsWorld | nullRemove the current physics world and optionally release it.
Parameters:
| Parameter | Type | Description |
|---|---|---|
destroy | boolean | - |
Returns: FlxPhysicsWorld | null
resetSubState()
ts
resetSubState(): voidApplies a deferred substate request. Normally called by the game loop.
Returns: void
setPhysicsWorld()
ts
setPhysicsWorld(world: FlxPhysicsWorld | null, destroyPrevious?: boolean): FlxPhysicsWorld | nullInstall a physics world and optionally destroy the previous one. The same world may be installed repeatedly without resetting it.
Parameters:
| Parameter | Type | Description |
|---|---|---|
world | FlxPhysicsWorld | null | - |
destroyPrevious | boolean | - |
Returns: FlxPhysicsWorld | null