Skip to content

Container<T>

Unofficial

Container for display objects.

Import:

import type { Container } from '@obsidian-typings/obsidian-public-latest';

Signature:

export class Container<T extends DisplayObject = DisplayObject> extends DisplayObject

Extends: DisplayObject

Properties

Property Type Description
alpha number Alpha (opacity).
(Inherited from DisplayObject)
angle number Rotation angle in degrees.
(Inherited from DisplayObject)
children T[] Children of this container (read-only).
cursor null | string Cursor style when hovering.
(Inherited from DisplayObject)
hitArea IHitArea | null Hit area shape.
(Inherited from DisplayObject)
interactive boolean Whether the object is interactive.
(Inherited from DisplayObject)
name null | string Display name.
(Inherited from DisplayObject)
parent Container Parent container.
renderable boolean Whether the object is renderable.
(Inherited from DisplayObject)
rotation number Rotation in radians.
(Inherited from DisplayObject)
sortableChildren boolean Whether children should be sorted by zIndex.
sortDirty boolean Whether the children need sorting.
transform Transform Transform data.
(Inherited from DisplayObject)
visible boolean Whether the object is visible.
(Inherited from DisplayObject)
worldAlpha number Alpha relative to the scene.
(Inherited from DisplayObject)
worldTransform Matrix World transform matrix (read-only).
(Inherited from DisplayObject)
worldVisible boolean Whether the object is visible in the scene (read-only).
(Inherited from DisplayObject)
x number X position.
(Inherited from DisplayObject)
y number Y position.
(Inherited from DisplayObject)
zIndex number Z-index for sorting.
(Inherited from DisplayObject)

Methods

Method Returns Description
addChild(children?) U[0] Adds one or more children to the container.
addChildAt(child, index) U Adds a child at a specific index.
destroy(options?) void Destroys this container.
emit(event, args?) boolean Emits an event.
(Inherited from DisplayObject)
getBounds(skipUpdate?, rect?) PixiRectangle Returns the bounds of the object.
(Inherited from DisplayObject)
getChildAt(index) T Returns the child at the given index.
getChildIndex(child) number Returns the index of a child.
getLocalBounds(rect?) PixiRectangle Returns the local bounds of the object.
(Inherited from DisplayObject)
off(event, fn?, context?) this Removes an event listener.
(Inherited from DisplayObject)
on(event, fn, context?) this Adds an event listener.
(Inherited from DisplayObject)
once(event, fn, context?) this Adds a one-time event listener.
(Inherited from DisplayObject)
removeAllListeners(event?) this Removes all listeners for the given event.
(Inherited from DisplayObject)
removeChild(children?) U[0] Removes one or more children from the container.
removeChildAt(index) T Removes the child at a specific index.
removeChildren(beginIndex?, endIndex?) T[] Removes children from the container.
setChildIndex(child, index) void Sets the index of a child.
sortChildren() void Sorts the children by zIndex.
toGlobal(position, point?, skipUpdate?) P Converts a point to global (screen) coordinates.
(Inherited from DisplayObject)
toLocal(position, from?, point?, skipUpdate?) P Converts a point to local coordinates.
(Inherited from DisplayObject)