Options
All
  • Public
  • Public/Protected
  • All
Menu

A container of object instances rendered on screen.

Hierarchy

Index

Methods

  • addLayer(layerData: LayerData): void
  • convertCoords(x: number, y: number, result?: FloatPoint): FloatPoint
  • Convert a point from the canvas coordinates (for example, the mouse position) to the container coordinates.

    Parameters

    • x: number

      The x position, in container coordinates.

    • y: number

      The y position, in container coordinates.

    • Optional result: FloatPoint

      The point instance that is used to return the result.

    Returns FloatPoint

  • convertInverseCoords(sceneX: number, sceneY: number, result: FloatPoint): FloatPoint
  • Convert a point from the container coordinates (for example, an object position) to the canvas coordinates.

    Parameters

    • sceneX: number

      The x position, in container coordinates.

    • sceneY: number

      The y position, in container coordinates.

    • result: FloatPoint

      The point instance that is used to return the result.

    Returns FloatPoint

  • createObjectsFrom(data: InstanceData[], xPos: number, yPos: number, trackByPersistentUuid: boolean): void
  • Create objects from initial instances data (for example, the initial instances of the scene or the instances of an external layout).

    Parameters

    • data: InstanceData[]

      The instances data

    • xPos: number

      The offset on X axis

    • yPos: number

      The offset on Y axis

    • trackByPersistentUuid: boolean

      If true, objects are tracked by setting their persistentUuid to the same as the associated instance. Useful for hot-reloading when instances are changed.

    Returns void

  • enableDebugDraw(enableDebugDraw: boolean, showHiddenInstances: boolean, showPointsNames: boolean, showCustomPoints: boolean): void
  • Activate or deactivate the debug visualization for collisions and points.

    Parameters

    • enableDebugDraw: boolean
    • showHiddenInstances: boolean
    • showPointsNames: boolean
    • showCustomPoints: boolean

    Returns void

  • getAllLayerNames(result: string[]): void
  • getElapsedTime(): number
  • getInitialSharedDataForBehavior(name: string): null | BehaviorSharedData
  • Get the data representing the initial shared data of the scene for the specified behavior.

    Parameters

    • name: string

      The name of the behavior

    Returns null | BehaviorSharedData

    The shared data for the behavior, if any.

  • getInstancesCountOnScene(objectName: string): number
  • Return the number of instances of the specified object living in the container.

    Parameters

    • objectName: string

      The object name for which instances must be counted.

    Returns number

  • getLayer(name: string): Layer
  • getViewportHeight(): number
  • getViewportOriginX(): number
  • getViewportOriginY(): number
  • getViewportWidth(): number
  • hasLayer(name: string): boolean
  • isObjectRegistered(objectName: string): boolean
  • Check if an object is registered, meaning that instances of it can be created and lives in the container.

    see

    gdjs.RuntimeInstanceContainer#registerObject

    Parameters

    • objectName: string

    Returns boolean

  • onChildrenLocationChanged(): void
  • registerObject(objectData: ObjectData): void
  • removeLayer(layerName: string): void
  • setInitialSharedDataForBehavior(name: string, sharedData: null | BehaviorSharedData): void
  • Set the data representing the initial shared data of the scene for the specified behavior.

    Parameters

    • name: string

      The name of the behavior

    • sharedData: null | BehaviorSharedData

      The shared data for the behavior, or null to remove it.

    Returns void

  • setLayerIndex(layerName: string, index: number): void
  • unregisterObject(objectName: string): void
  • updateObject(objectData: ObjectData): void
  • updateObjectsForces(): void

Constructors

Properties

pathfindingObstaclesManager: PathfindingObstaclesManager
tileMapCollisionMaskManager: TileMapRuntimeManager

Generated using TypeDoc