A container of object instances rendered on screen.

Hierarchy (view full)

Constructors

Properties

pathfindingObstaclesManager: PathfindingObstaclesManager
tileMapCollisionMaskManager: TileMapRuntimeManager

Methods

  • 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

  • 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

  • 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

    • zPos: number

      The offset on Z 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

  • Activate or deactivate the debug visualization for collisions and points.

    Parameters

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

    Returns void

  • Fill the array passed as argument with the names of all layers

    Parameters

    • result: string[]

      The array where to put the layer names

    Returns void

  • 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.

  • 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

  • Check if an object is registered, meaning that instances of it can be created and lives in the container.

    Parameters

    • objectName: string

    Returns boolean

    See

    gdjs.RuntimeInstanceContainer#registerObject

  • 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

  • Change the position of a layer.

    Parameters

    • layerName: string

      The name of the layer to reorder

    • newIndex: number

      The new position in the list of layers

    Returns void