Skip to content

StateManager

Manages all states.

Extends

Type parameters

T extends Application = Application

Constructors

new StateManager()

new StateManager<T>(_app): StateManager<T>

Parameters

_app: Application<any>

Returns

StateManager<T>

Overrides

Container.constructor

Source

src/state/StateManager.ts:112

Properties

childrenEditable

childrenEditable: boolean = true

Inherited from

Container.childrenEditable

Source

src/gameobjects/Container.ts:22


editable

editable: boolean = true

Inherited from

Container.editable

Source

src/gameobjects/Container.ts:21


__dill_pixel_top_level_class

static __dill_pixel_top_level_class: boolean = true

Inherited from

Container.__dill_pixel_top_level_class

Source

src/gameobjects/Container.ts:20

Accessors

add

get add(): Add

Returns

Add

Source

src/gameobjects/Container.ts:120


app

get app(): T

Returns

T

Source

src/gameobjects/Container.ts:128


current

get current(): undefined | State<Application<any>>

Returns

undefined | State<Application<any>>

Source

src/state/StateManager.ts:157


currentId

get currentId(): string

Returns

string

Source

src/state/StateManager.ts:161


debug

set debug(pEnabled): void

Enabling this will print all debug logs.

Parameters

pEnabled: boolean

Source

src/state/StateManager.ts:152


default

get default(): undefined | string

Returns

undefined | string

Source

src/state/StateManager.ts:145


defaultTransitionType

set defaultTransitionType(transitionType): void

Parameters

transitionType: TransitionStep[]

Source

src/state/StateManager.ts:141


editMode

get editMode(): boolean

set editMode(value): void

Parameters

value: boolean

Returns

boolean

Source

src/gameobjects/Container.ts:107


focusPosition

get focusPosition(): Point

set focusPosition(value): void

Parameters

value: Point

Returns

Point

Source

src/gameobjects/Container.ts:83


focusSize

get focusSize(): Point

set focusSize(value): void

Parameters

value: Point

Returns

Point

Source

src/gameobjects/Container.ts:91


focusable

get focusable(): boolean

set focusable(value): void

Parameters

value: boolean

Returns

boolean

Source

src/gameobjects/Container.ts:99


make

get make(): typeof Make

Returns

typeof Make

Source

src/gameobjects/Container.ts:124


useAsCaptionTarget

get useAsCaptionTarget(): boolean

set useAsCaptionTarget(value): void

Parameters

value: boolean

Returns

boolean

Source

src/gameobjects/Container.ts:61


useDebugMenu

set useDebugMenu(value): void

Parameters

value: boolean

Source

src/state/StateManager.ts:133


useHash

set useHash(value): void

Parameters

value: boolean

Source

src/state/StateManager.ts:126


voiceover

get voiceover(): string

set voiceover(value): void

Parameters

value: string

Returns

string

Source

src/gameobjects/Container.ts:69

Methods

destroy()

destroy(_options?): void

Parameters

_options?: boolean | IDestroyOptions

Returns

void

Inherited from

Container.destroy

Source

src/gameobjects/Container.ts:132


disableEditMode()

disableEditMode(): void

Returns

void

Inherited from

Container.disableEditMode

Source

src/gameobjects/Container.ts:173


enableEditMode()

enableEditMode(): void

Returns

void

Inherited from

Container.enableEditMode

Source

src/gameobjects/Container.ts:169


excludeFromDebugList()

excludeFromDebugList(name): void

Parameters

name: string

Returns

void

Source

src/state/StateManager.ts:346


getFocusPosition()

getFocusPosition(): Point

Gets the position in global coordinate space that the focus should be centred around.

Returns

Point

The position that the focus should be centred around.

Inherited from

Container.getFocusPosition

Source

src/gameobjects/Container.ts:157


getFocusSize()

getFocusSize(): IPoint

Gets the size of the area in global coordinate space that the focus should surround.

Returns

IPoint

The size of the area that the focus should surround.

Inherited from

Container.getFocusSize

Source

src/gameobjects/Container.ts:161


getRegisteredStateIds()

getRegisteredStateIds(): string[]

Returns

string[]

Source

src/state/StateManager.ts:326


getStateFromHash()

getStateFromHash(): null | string

Returns

null | string

Source

src/state/StateManager.ts:330


isFocusable()

isFocusable(): boolean

Returns

boolean

true if this focusable can be focused Defaults to this.interactive && this.worldVisible

Inherited from

Container.isFocusable

Source

src/gameobjects/Container.ts:165


onFocusActivated()

onFocusActivated(): void

Called when this Focusable is focussed and then activated.

Returns

void

Inherited from

Container.onFocusActivated

Source

src/gameobjects/Container.ts:155


onFocusBegin()

onFocusBegin(): void

Called when this Focusable is focussed.

Returns

void

Inherited from

Container.onFocusBegin

Source

src/gameobjects/Container.ts:143


onFocusEnd()

onFocusEnd(): void

Called when this Focusable is no longer focussed.

Returns

void

Inherited from

Container.onFocusEnd

Source

src/gameobjects/Container.ts:149


onResize()

onResize(size): void

Called when the window is resized.

Parameters

size: Point

The new size.

Returns

void

Overrides

Container.onResize

Source

src/state/StateManager.ts:179


register()

register(stateIdOrClass, creationMethod?, autoAddAssets?): void

Registers a state so that it can be transitioned to.

Parameters

stateIdOrClass: string | typeof State | typeof State

The id of the new state or the class of the new state.

creationMethod?

A function that constructs the state.

autoAddAssets?: boolean= true

whether to automatically register the asset group for this state - only works if stateIdOrClass is a class

Returns

void

Source

src/state/StateManager.ts:195


showDebugMenu()

showDebugMenu(): void

Returns

void

Source

src/state/StateManager.ts:226


statesRegistered()

statesRegistered(): void

Returns

void

Source

src/state/StateManager.ts:216


transitionTo()

transitionTo(stateIdAndData, loadScreen?, transitionSteps?): boolean

Method to transition states instead call this.app.state.transitionTo(stateId, loadScreenId)

Parameters

stateIdAndData: string | typeof State | object

loadScreen?: string

transitionSteps?: TransitionStep[]

Returns

boolean

Source

src/state/StateManager.ts:290


update()

update(deltaTime): void

Updates the current active state.

Parameters

deltaTime: number

ticker.shared.elapsedMS / 1000.

Returns

void

Overrides

Container.update

Source

src/state/StateManager.ts:169