Options
Menu

Class StageManager

The StageManager class provides a multiton object that handles management for Stage objects.

see

away.base.Stage

Hierarchy

  • EventDispatcher

Index

Constructors

Private constructor

  • Creates a new StageManager class.

    Returns StageManager

Accessors

hasFreeStage

  • get (): boolean
  • Checks if a new stage can be created and managed by the class.

    Returns boolean

    true if there is one slot free for a new stage

numSlotsFree

  • get (): number
  • Returns the amount of stage objects that can be created and managed by the class

    Returns number

    the amount of free slots

numSlotsTotal

  • get (): number
  • The maximum amount of Stage objects that can be managed by the class

    Returns number

numSlotsUsed

  • get (): number
  • Returns the amount of Stage objects currently managed by the class.

    Returns number

    the amount of slots used

Methods

addEventListener

  • addEventListener(type: string, listener: function): void
  • Add an event listener

    method

    addEventListener

    Parameters

    • type: string
    • listener: function
        • (event: EventBase): void
        • Parameters

          • event: EventBase

          Returns void

    Returns void

dispatchEvent

  • dispatchEvent(event: EventBase): void
  • Dispatch an event

    method

    dispatchEvent

    Parameters

    • event: EventBase

    Returns void

getFreeStage

  • Get the next available stage. An error is thrown if there are no StageProxies available

    Parameters

    • Default value forceSoftware: boolean = false

      Whether to force software mode even if hardware acceleration is available.

    • Default value profile: ContextGLProfile = ContextGLProfile.BASELINE

      The compatibility profile, an enumeration of ContextProfile

    • Default value mode: ContextMode = ContextMode.AUTO

    Returns Stage

    The allocated stage

getStageAt

  • Requests the Stage for the given index.

    Parameters

    • index: number

      The index of the requested Stage.

    • Default value forceSoftware: boolean = false

      Whether to force software mode even if hardware acceleration is available.

    • Default value profile: ContextGLProfile = ContextGLProfile.BASELINE

      The compatibility profile, an enumeration of ContextProfile

    • Default value mode: ContextMode = ContextMode.AUTO

    Returns Stage

    The Stage for the given index.

hasEventListener

  • hasEventListener(type: string, listener?: function): boolean
  • check if an object has an event listener assigned to it

    method

    hasListener

    Parameters

    • type: string
    • Optional listener: function
        • (event: EventBase): void
        • Parameters

          • event: EventBase

          Returns void

    Returns boolean

Private iRemoveStage

  • iRemoveStage(stage: Stage): void
  • Removes a Stage from the manager.

    Parameters

    Returns void

removeEventListener

  • removeEventListener(type: string, listener: function): void
  • Remove an event listener

    method

    removeEventListener

    Parameters

    • type: string
    • listener: function
        • (event: EventBase): void
        • Parameters

          • event: EventBase

          Returns void

    Returns void

Static getInstance

  • Gets a StageManager instance for the given Stage object.

    Returns StageManager

    The StageManager instance for the given Stage object.

Generated using TypeDoc