@pietal.dev/engine
    Preparing search index...

    Class Container

    Hierarchy

    • Container
      • Container

    Implements

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    _accessibleActive?: boolean
    _accessibleDiv?: AccessibleHTMLElement
    _filterEffect?: FilterEffect
    _internalEventMode: EventMode
    _localBoundsCacheData: LocalBoundsCacheData
    _localBoundsCacheId: number
    _maskEffect?: MaskEffect
    _maskOptions?: MaskOptions
    _onRender: (renderer: Renderer) => void
    _renderId?: number
    _zIndex: number
    accessible?: boolean

    Flag for if the object is accessible. If true AccessibilityManager will overlay a shadow div with attributes set

    false
    
    accessibleChildren?: boolean

    Setting to false will prevent any children inside this container to be accessible. Defaults to true.

    true
    
    accessibleHint?: string

    Sets the aria-label attribute of the shadow div

    accessiblePointerEvents?: PointerEvents
    accessibleText?: string

    Sets the text content of the shadow div

    accessibleTitle?: string

    Sets the title attribute of the shadow div If accessibleTitle AND accessibleHint has not been this will default to 'container [tabIndex]'

    accessibleType?: keyof HTMLElementTagNameMap

    Specify the type of div the accessible layer is. Screen readers treat the element differently depending on this type. Defaults to button.

    'button'
    
    allowChildren: boolean
    boundsArea: Rectangle

    An optional bounds area for this container. Setting this rectangle will stop the renderer from recursively measuring the bounds of each children and instead use this single boundArea. This is great for optimisation! If for example you have a 1000 spinning particles and you know they all sit within a specific bounds, then setting it will mean the renderer will not need to measure the 1000 children to find the bounds. Instead it will just use the bounds you set.

    cacheAsBitmap: boolean

    Legacy property for backwards compatibility with PixiJS v7 and below. Use cacheAsTexture instead.

    Since PixiJS v8

    scene.Container#

    cacheAsTexture: (val: boolean | CacheAsTextureOptions) => void

    Caches this container as a texture. This allows the container to be rendered as a single texture, which can improve performance for complex static containers.

    Type declaration

      • (val: boolean | CacheAsTextureOptions): void
      • Parameters

        • val: boolean | CacheAsTextureOptions

          If true, enables caching with default options. If false, disables caching. Can also pass options object to configure caching behavior.

        Returns void

    scene.Container#

    children: ContainerChild[]

    The array of children of this container.

    cullable?: boolean

    Should this object be rendered if the bounds of this object are out of frame?

    Culling has no effect on whether updateTransform is called.

    false
    

    scene.Container#

    cullableChildren?: boolean

    Determines if the children to the container can be culled Setting this to false allows PixiJS to bypass a recursive culling function Which can help to optimize very complex scenes

    true
    

    scene.Container#

    cullArea?: Rectangle

    If set, this shape is used for culling instead of the bounds of this object. It can improve the culling performance of objects with many children. The culling area is defined in local space.

    scene.Container#

    cursor?: string

    The cursor preferred when the mouse pointer is hovering over.

    depthOfChildModified: () => void
    destroy$: Subject<void> = ...

    When Lifecycle Object is destroyed, it emits and closes this subject. Along with destroying his children, which in turn behave the same.

    destroyed: boolean

    If the object has been destroyed via destroy(). If true, it should not be used.

    effects?: Effect[]
    eventMode?: EventMode

    The mode of interaction for this object

    filterArea?: Rectangle
    filters: Filter | Filter[]
    gameObject: LifecycleParent

    Parent GameObject is assigned at creation.

    groupAlpha: number
    groupColor: number
    groupColorAlpha: number
    groupTransform: Matrix

    The group transform is a transform relative to the render group it belongs too. If this container is render group then this will be an identity matrix. other wise it will be the same as the relativeGroupTransform. Use this value when actually rendering things to the screen

    hitArea?: IHitArea

    The hit-area specifies the area for which pointer events should be captured by this event target.

    interactive?: boolean

    Whether this event target should fire UI events.

    interactiveChildren?: boolean

    Whether this event target has any children that need UI events. This can be used optimize event propagation.

    isCachedAsTexture: boolean

    Whether this container is currently cached as a texture.

    scene.Container#

    isInteractive: () => boolean

    Returns true if the Container has interactive 'static' or 'dynamic'

    label: string = 'Container'

    Each Lifecycle Object has label for pixi debugging.

    layerParentId: string
    localAlpha: number
    localColor: number
    localTransform: Matrix

    Current transform of the object based on local factors: position, scale, other stuff.

    mask: Mask
    name: string

    since 8.0.0

    Container#label

    onclick?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'click' event

    onglobalmousemove?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'globalmousemove' event

    onglobalpointermove?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'globalpointermove' event

    onglobaltouchmove?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'globaltouchmove' event

    onmousedown?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'mousedown' event

    onmouseenter?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'mouseenter' event

    onmouseleave?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'mouseleave' event

    onmousemove?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'mousemove' event

    onmouseout?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'mouseout' event

    onmouseover?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'mouseover' event

    onmouseup?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'mouseup' event

    onmouseupoutside?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'mouseupoutside' event

    onpointercancel?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'pointercancel' event

    onpointerdown?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'pointerdown' event

    onpointerenter?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'pointerenter' event

    onpointerleave?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'pointerleave' event

    onpointermove?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'pointermove' event

    onpointerout?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'pointerout' event

    onpointerover?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'pointerover' event

    onpointertap?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'pointertap' event

    onpointerup?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'pointerup' event

    onpointerupoutside?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'pointerupoutside' event

    onRender: (renderer: Renderer) => void
    onrightclick?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'rightclick' event

    onrightdown?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'rightdown' event

    onrightup?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'rightup' event

    onrightupoutside?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'rightupoutside' event

    ontap?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'tap' event

    ontouchcancel?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'touchcancel' event

    ontouchend?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'touchend' event

    ontouchendoutside?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'touchendoutside' event

    ontouchmove?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'touchmove' event

    ontouchstart?: FederatedEventHandler<FederatedPointerEvent>

    Handler for 'touchstart' event

    onwheel?: FederatedEventHandler<FederatedWheelEvent>

    Handler for 'wheel' event

    parent: Container

    The display object container that contains this display object.

    parentRenderLayer: IRenderLayer

    The RenderLayer this container belongs to, if any. If it belongs to a RenderLayer, it will be rendered from the RenderLayer's position in the scene.

    relativeGroupTransform: Matrix

    The relative group transform is a transform relative to the render group it belongs too. It will include all parent transforms and up to the render group (think of it as kind of like a stage - but the stage can be nested). If this container is is self a render group matrix will be relative to its parent render group

    renderPipeId: string
    setMask: (options: Partial<MaskOptionsAndMask>) => void
    sortableChildren: boolean
    sortChildren: () => void
    sortDirty: boolean
    tabIndex?: number
    0
    
    uid: number

    unique id for this container

    update$: Subject<number> = ...

    When Lifecycle Object is updated, it emits this subject. Along with updating his children, which in turn behave the same.

    updateCacheTexture: () => void

    Updates the cached texture of this container. This will flag the container's cached texture to be redrawn on the next render.

    scene.Container#

    zIndex: number
    prefixed: string | boolean

    Accessors

    • get _didChangeId(): number

      Returns number

    • get alpha(): number

      The opacity of the object.

      Returns number

    • set alpha(value: number): void

      Parameters

      • value: number

      Returns void

    • get angle(): number

      The angle of the object in degrees. 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.

      Returns number

    • set angle(value: number): void

      Parameters

      • value: number

      Returns void

    • get blendMode(): BLEND_MODES

      The blend mode to be applied to the sprite. Apply a value of 'normal' to reset the blend mode.

      Returns BLEND_MODES

      'normal'
      
    • set blendMode(value: BLEND_MODES): void

      Parameters

      • value: BLEND_MODES

      Returns void

    • get height(): number

      The height of the Container, setting this will actually modify the scale to achieve the value set.

      Returns number

      scene.Container#

    • set height(value: number): void

      Parameters

      • value: number

      Returns void

    • get isRenderable(): boolean

      Whether or not the object should be rendered.

      Returns boolean

    • get isRenderGroup(): boolean

      Returns true if this container is a render group. This means that it will be rendered as a separate pass, with its own set of instructions

      Returns boolean

    • set isRenderGroup(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get pivot(): ObservablePoint

      The center of rotation, scaling, and skewing for this display object in its local space. The position is the projection of pivot in the parent's local space.

      By default, the pivot is the origin (0, 0).

      Returns ObservablePoint

      4.0.0

    • set pivot(value: number | PointData): void

      Parameters

      • value: number | PointData

      Returns void

    • get position(): ObservablePoint

      The coordinate of the object relative to the local coordinates of the parent.

      Returns ObservablePoint

      4.0.0

    • set position(value: PointData): void

      Parameters

      • value: PointData

      Returns void

    • get renderable(): boolean

      Can this object be rendered, if false the object will not be drawn but the transform will still be updated.

      Returns boolean

    • set renderable(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get rotation(): number

      The rotation of the object in radians. 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.

      Returns number

    • set rotation(value: number): void

      Parameters

      • value: number

      Returns void

    • get scale(): ObservablePoint

      The scale factors of this object along the local coordinate axes.

      The default scale is (1, 1).

      Returns ObservablePoint

      4.0.0

    • set scale(value: number | PointData): void

      Parameters

      • value: number | PointData

      Returns void

    • get skew(): ObservablePoint

      The skew factor for the object in radians.

      Returns ObservablePoint

      4.0.0

    • set skew(value: PointData): void

      Parameters

      • value: PointData

      Returns void

    • get tint(): number

      The tint applied to the sprite. This is a hex value.

      A value of 0xFFFFFF will remove any tint effect.

      Returns number

      0xFFFFFF
      
    • set tint(value: ColorSource): void

      Parameters

      • value: ColorSource

      Returns void

    • get visible(): boolean

      The visibility of the object. If false the object will not be drawn, and the transform will not be updated.

      Returns boolean

    • set visible(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get width(): number

      The width of the Container, setting this will actually modify the scale to achieve the value set.

      Returns number

      scene.Container#

    • set width(value: number): void

      Parameters

      • value: number

      Returns void

    • get worldTransform(): Matrix

      Current transform of the object based on world (parent) factors.

      Returns Matrix

    • get x(): number

      The position of the container on the x axis relative to the local coordinates of the parent. An alias to position.x

      Returns number

    • set x(value: number): void

      Parameters

      • value: number

      Returns void

    • get y(): number

      The position of the container on the y axis relative to the local coordinates of the parent. An alias to position.y

      Returns number

    • set y(value: number): void

      Parameters

      • value: number

      Returns void

    Methods

    • Recursively calculates the global bounds for the container and its children. This method is used internally by getFastGlobalBounds to traverse the scene graph.

      Parameters

      • factorRenderLayers: boolean

        A flag indicating whether to consider render layers in the calculation.

      • bounds: Bounds

        The bounds object to update with the calculated values.

      • currentLayer: IRenderLayer

        The current render layer being processed.

      Returns void

      scene.Container#

    • Returns void

    • Parameters

      • height: number
      • localHeight: number

      Returns void

    • Parameters

      • width: number
      • localWidth: number

      Returns void

    • Adds one or more children to the container.

      Multiple items can be added like so: myContainer.addChild(thingOne, thingTwo, thingThree)

      Type Parameters

      • U extends (ContainerChild | IRenderLayer)[]

      Parameters

      • ...children: U

        The Container(s) to add to the container

      Returns U[0]

      • The first child that was added.
    • Type Parameters

      • U extends ContainerChild | IRenderLayer

      Parameters

      • child: U
      • index: number

      Returns U

    • Parameters

      • effect: Effect

      Returns void

    • Type Parameters

      • K extends (keyof FederatedEventMap) | (keyof GlobalFederatedEventMap)

      Parameters

      • type: K
      • listener: (e: AllFederatedEventMap[K]) => any
      • Optionaloptions: AddListenerOptions

      Returns void

    • Parameters

      • type: string
      • listener: EventListenerOrEventListenerObject
      • Optionaloptions: AddListenerOptions

      Returns void

    • Type Parameters

      • T extends (keyof ContainerEvents<ContainerChild>) | (keyof AnyEvent)

      Parameters

      • event: T
      • fn: (
            ...args: ArgumentMap<ContainerEvents<ContainerChild> & AnyEvent>[Extract<
                T,
                (keyof ContainerEvents<ContainerChild>)
                | (keyof AnyEvent),
            >],
        ) => void
      • Optionalcontext: any

      Returns this

    • Collects all renderables from the container and its children, adding them to the instruction set. This method decides whether to use a simple or advanced collection method based on the container's properties.

      Parameters

      • instructionSet: InstructionSet

        The set of instructions to which the renderables will be added.

      • renderer: Renderer

        The renderer responsible for rendering the scene.

      • currentLayer: IRenderLayer

        The current render layer being processed.

      Returns void

      scene.Container#

    • Collects renderables using a simple method, suitable for containers marked as simple. This method iterates over the container's children and adds their renderables to the instruction set.

      Parameters

      • instructionSet: InstructionSet

        The set of instructions to which the renderables will be added.

      • renderer: Renderer

        The renderer responsible for rendering the scene.

      • currentLayer: IRenderLayer

        The current render layer being processed.

      Returns void

      scene.Container#

    • Collects renderables using an advanced method, suitable for containers with complex processing needs. This method handles additional effects and transformations that may be applied to the renderables.

      Parameters

      • instructionSet: InstructionSet

        The set of instructions to which the renderables will be added.

      • renderer: Renderer

        The renderer responsible for rendering the scene.

      • currentLayer: IRenderLayer

        The current render layer being processed.

      Returns void

      scene.Container#

    • Removes all internal references and listeners as well as removes children from the display list. Do not use a Container after calling destroy.

      Returns void

    • This will disable the render group for this container.

      Returns void

    • Parameters

      • e: FederatedEvent

      Returns boolean

    • Calls each of the listeners registered for a given event.

      Type Parameters

      • T extends (keyof ContainerEvents<ContainerChild>) | (keyof AnyEvent)

      Parameters

      • event: T
      • ...args: ArgumentMap<ContainerEvents<ContainerChild> & AnyEvent>[Extract<
            T,
            (keyof ContainerEvents<ContainerChild>)
            | (keyof AnyEvent),
        >]

      Returns boolean

    • Calling this enables a render group for this container. This means it will be rendered as a separate set of instructions. The transform of the container will also be handled on the GPU rather than the CPU.

      Returns void

    • Return an array listing the events for which the emitter has registered listeners.

      Returns ((keyof ContainerEvents<ContainerChild>) | (keyof AnyEvent))[]

    • Parameters

      • OptionalskipUpdate: boolean
      • Optionalbounds: Bounds

      Returns Bounds

    • Type Parameters

      • U extends ContainerChild | IRenderLayer

      Parameters

      • index: number

      Returns U

    • Parameters

      • label: string | RegExp
      • Optionaldeep: boolean

      Returns Container<ContainerChild>

    • Parameters

      • label: string | RegExp
      • Optionaldeep: boolean

      Returns Container<ContainerChild>

    • Parameters

      • child: ContainerChild | IRenderLayer

      Returns number

    • Parameters

      • label: string | RegExp
      • Optionaldeep: boolean
      • Optionalout: Container<ContainerChild>[]

      Returns Container<ContainerChild>[]

    • Computes an approximate global bounding box for the container and its children. This method is optimized for speed by using axis-aligned bounding boxes (AABBs), and uses the last render results from when it updated the transforms. This function does not update them. which may result in slightly larger bounds but never smaller than the actual bounds.

      for accurate (but less performant) results use container.getGlobalBounds

      Parameters

      • OptionalfactorRenderLayers: boolean

        A flag indicating whether to consider render layers in the calculation.

      • Optionalbounds: Bounds

        The output bounds object to store the result. If not provided, a new one is created.

      Returns Bounds

      The computed bounds.

      scene.Container#

    • Parameters

      • skipUpdate: boolean

      Returns number

    • Parameters

      • Optionalpoint: Point
      • OptionalskipUpdate: boolean

      Returns Point

    • Parameters

      • OptionalskipUpdate: boolean

      Returns number

    • Parameters

      • matrix: Matrix
      • skipUpdate: boolean

      Returns Matrix

    • Parameters

      • Optionalbounds: Bounds

      Returns Bounds

    • Retrieves the size of the container as a [Size]Size object. This is faster than get the width and height separately.

      Parameters

      • Optionalout: Size

        Optional object to store the size in.

      Returns Size

      • The size of the container.

      scene.Container#

    • Return the number of listeners listening to a given event.

      Parameters

      • event: (keyof ContainerEvents<ContainerChild>) | (keyof AnyEvent)

      Returns number

    • Return the listeners registered for a given event.

      Type Parameters

      • T extends (keyof ContainerEvents<ContainerChild>) | (keyof AnyEvent)

      Parameters

      • event: T

      Returns (
          (
              ...args: ArgumentMap<ContainerEvents<ContainerChild> & AnyEvent>[Extract<
                  T,
                  (keyof ContainerEvents<ContainerChild>)
                  | (keyof AnyEvent),
              >],
          ) => void
      )[]

    • Type Parameters

      • T extends (keyof ContainerEvents<ContainerChild>) | (keyof AnyEvent)

      Parameters

      • event: T
      • Optionalfn: (
            ...args: ArgumentMap<ContainerEvents<ContainerChild> & AnyEvent>[Extract<
                T,
                (keyof ContainerEvents<ContainerChild>)
                | (keyof AnyEvent),
            >],
        ) => void
      • Optionalcontext: any
      • Optionalonce: boolean

      Returns this

    • Add a listener for a given event.

      Type Parameters

      • T extends (keyof ContainerEvents<ContainerChild>) | (keyof AnyEvent)

      Parameters

      • event: T
      • fn: (
            ...args: ArgumentMap<ContainerEvents<ContainerChild> & AnyEvent>[Extract<
                T,
                (keyof ContainerEvents<ContainerChild>)
                | (keyof AnyEvent),
            >],
        ) => void
      • Optionalcontext: any

      Returns this

    • Add a one-time listener for a given event.

      Type Parameters

      • T extends (keyof ContainerEvents<ContainerChild>) | (keyof AnyEvent)

      Parameters

      • event: T
      • fn: (
            ...args: ArgumentMap<ContainerEvents<ContainerChild> & AnyEvent>[Extract<
                T,
                (keyof ContainerEvents<ContainerChild>)
                | (keyof AnyEvent),
            >],
        ) => void
      • Optionalcontext: any

      Returns this

    • Remove all listeners, or those of the specified event.

      Parameters

      • Optionalevent: (keyof ContainerEvents<ContainerChild>) | (keyof AnyEvent)

      Returns this

    • Removes one or more children from the container.

      Type Parameters

      • U extends (ContainerChild | IRenderLayer)[]

      Parameters

      • ...children: U

        The Container(s) to remove

      Returns U[0]

      The first child that was removed.

    • Type Parameters

      • U extends ContainerChild | IRenderLayer

      Parameters

      • index: number

      Returns U

    • Parameters

      • OptionalbeginIndex: number
      • OptionalendIndex: number

      Returns ContainerChild[]

    • Parameters

      • effect: Effect

      Returns void

    • Type Parameters

      • K extends (keyof FederatedEventMap) | (keyof GlobalFederatedEventMap)

      Parameters

      • type: K
      • listener: (e: AllFederatedEventMap[K]) => any
      • Optionaloptions: RemoveListenerOptions

      Returns void

    • Parameters

      • type: string
      • listener: EventListenerOrEventListenerObject
      • Optionaloptions: RemoveListenerOptions

      Returns void

    • Returns void

    • Remove the listeners of a given event.

      Type Parameters

      • T extends (keyof ContainerEvents<ContainerChild>) | (keyof AnyEvent)

      Parameters

      • event: T
      • Optionalfn: (
            ...args: ArgumentMap<ContainerEvents<ContainerChild> & AnyEvent>[Extract<
                T,
                (keyof ContainerEvents<ContainerChild>)
                | (keyof AnyEvent),
            >],
        ) => void
      • Optionalcontext: any
      • Optionalonce: boolean

      Returns this

    • Type Parameters

      • U extends ContainerChild[]

      Parameters

      • ...child: U

      Returns U[0]

    • Type Parameters

      • U extends ContainerChild

      Parameters

      • child: U
      • index: number

      Returns U

    • Parameters

      • child: ContainerChild | IRenderLayer
      • index: number

      Returns void

    • Updates the local transform using the given matrix.

      Parameters

      • matrix: Matrix

        The matrix to use for updating the transform.

      Returns void

    • Sets the size of the container to the specified width and height. This is faster than setting the width and height separately.

      Parameters

      • value: number | Optional<Size, "height">

        This can be either a number or a [Size]Size object.

      • Optionalheight: number

        The height to set. Defaults to the value of width if not provided.

      Returns void

      scene.Container#

    • Type Parameters

      • U extends ContainerChild | IRenderLayer

      Parameters

      • child: U
      • child2: U

      Returns void

    • Type Parameters

      • P extends PointData = Point

      Parameters

      • position: PointData
      • Optionalpoint: P
      • OptionalskipUpdate: boolean

      Returns P

    • Type Parameters

      • P extends PointData = Point

      Parameters

      • position: PointData
      • Optionalfrom: Container
      • Optionalpoint: P
      • OptionalskipUpdate: boolean

      Returns P

    • Updates the local transform.

      Returns void

    • Updates the transform properties of the container (accepts partial values).

      Parameters

      • opts: Partial<UpdateTransformOptions>

        The options for updating the transform.

        • x

          The x position of the container.

        • y

          The y position of the container.

        • scaleX

          The scale factor on the x-axis.

        • scaleY

          The scale factor on the y-axis.

        • rotation

          The rotation of the container, in radians.

        • skewX

          The skew factor on the x-axis.

        • skewY

          The skew factor on the y-axis.

        • pivotX

          The x coordinate of the pivot point.

        • pivotY

          The y coordinate of the pivot point.

      Returns this

    • Mixes all enumerable properties and methods from a source object to Container.

      Parameters

      • source: Dict<any>

        The source of properties and methods to mix in.

      Returns void

      since 8.8.0