class GameStateManager : Object

A state manager that uses a stack to hold states. Implementation taken from https://github.com/tesselode/roomy.

__new(self: GameStateManager)
emit(self: GameStateManager, event: string, ...: any)

Emits an event to the current state, passing any extra parameters along to it.

Parameters:
  • event (string) – The event to emit.

  • ... (any) – Additional parameters to pass to the state.

enter(self: GameStateManager, next: any, ...: any)

Changes the currently active state.

Parameters:

... (any) – Additional parameters to pass to the state.

push(self: GameStateManager, next: GameState, ...: any)

Pushes a new state onto the stack, making it the new active state.

Parameters:
  • next (GameState) – The state to push.

  • ... (any) – Additional parameters to pass to the state.

pop(self: GameStateManager, ...: any)

Removes the active state from the stack and resumes the previous one.

Parameters:

... (any) – Additional parameters to pass to the state.

hook(self: GameStateManager, options?: {include: string[], exclude: string[]})

Hooks the love callbacks into the manager’s, overwriting the originals.

Parameters:

options? ({include: string[], exclude: string[]}) – Lists of callbacks to include or exclude.