API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classContainer

@codexo/exojs / rendering / stable

Scene-graph node that owns child RenderNodes. Renders its subtree in document order with local `zIndex` ordering resolved inside the internal render plan at playback time. Bounds aggregate the local bounds + every visible child's bounds, so `container.getBounds()` always returns the smallest axis-aligned rectangle containing the subtree. Width/height accessors derive from the bounds (× `scale`) and writing to them rescales `scale` to fit. Adding a child re-parents it: the previous parent is detached automatically. Removing a child cascades bounds invalidation up the ancestor chain so further-up containers also rebuild on next read. Subclassed by Sprite, Mesh, Graphics, Text, etc. — the base `Container` is a non-drawing grouping node.

32
props
40
methods
9
events
Import
import { Container } from '@codexo/exojs'

Scene-graph node that owns child RenderNodes. Renders its subtree in document order with local `zIndex` ordering resolved inside the internal render plan at playback time.

Bounds aggregate the local bounds + every visible child's bounds, so `container.getBounds()` always returns the smallest axis-aligned rectangle containing the subtree. Width/height accessors derive from the bounds (× `scale`) and writing to them rescales `scale` to fit.

Adding a child re-parents it: the previous parent is detached automatically. Removing a child cascades bounds invalidation up the ancestor chain so further-up containers also rebuild on next read.

Subclassed by Sprite, Mesh, Graphics, Text, etc. — the base `Container` is a non-drawing grouping node.

Constructors 1
new(): Container
Methods 40
_invalidateBoundsCascade(): void
_invalidateChildrenTransform(): void
_invalidateSubtreeTransform(): void
addChild(children: RenderNode[]): this
addChildAt(child: RenderNode, index: number): this
addFilter(filter: Filter): this
clearFilters(): this
collidesWith(target: Collidable): CollisionResponse | null
contains(x: number, y: number): boolean
destroy(): void
getBounds(): Rectangle
getChildAt(index: number): RenderNode
getChildIndex(child: RenderNode): number
getGlobalTransform(): Matrix
getLocalBounds(): Rectangle
getNormals(): Vector[]
getTransform(): Matrix
intersectsWith(target: Collidable): boolean
invalidateCache(): this
inView(view: View): boolean
move(x: number, y: number): this
project(axis: Vector, result: Interval): Interval
removeChild(child: RenderNode): this
removeChildAt(index: number): this
removeChildren(begin: number, end: number): this
removeFilter(filter: Filter): this
render(backend: RenderBackend): this
rotate(degrees: number): this
setAnchor(x: number, y: number): this
setChildIndex(child: RenderNode, index: number): this
setOrigin(x: number, y: number): this
setPosition(x: number, y: number): this
setRotation(degrees: number): this
setScale(x: number, y: number): this
setSkew(x: number, y: number): this
swapChildren(firstChild: RenderNode, secondChild: RenderNode): this
updateBounds(): this
updateParentTransform(): this
updateTransform(): this
setInternalSpriteFactory(factory: object | null): void
Properties 32
clip: boolean
clipShape: Rectangle | Geometry | null
collisionType: CollisionType
cursor: string | null
draggable: boolean
flags: Flags<SceneNodeTransformFlags>
preserveDrawOrder: boolean
anchor: ObservableVector
bottom: number
cacheAsBitmap: boolean
children: RenderNode[]
cullable: boolean
filters: readonly Filter[]
height: number
interactive: boolean
isAlignedBox: boolean
left: number
mask: MaskSource
origin: ObservableVector
parent: Container | null
position: ObservableVector
right: number
rotation: number
scale: ObservableVector
skewX: number
skewY: number
top: number
visible: boolean
width: number
x: number
y: number
zIndex: number
Events 9
onDrag: Signal<[InteractionEvent]>
onDragEnd: Signal<[InteractionEvent]>
onDragStart: Signal<[InteractionEvent]>
onPointerDown: Signal<[InteractionEvent]>
onPointerMove: Signal<[InteractionEvent]>
onPointerOut: Signal<[InteractionEvent]>
onPointerOver: Signal<[InteractionEvent]>
onPointerTap: Signal<[InteractionEvent]>
onPointerUp: Signal<[InteractionEvent]>
Source