Skip to content

Sprite

Unofficial

Sprite display object.

Import:

import type { Sprite } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export class Sprite extends Container

Extends: Container

Properties

PropertyTypeDescription
alphanumberAlpha (opacity).
(Inherited from Container)
anglenumberRotation angle in degrees.
(Inherited from Container)
childrenT[]Children of this container (read-only).
(Inherited from Container)
cursornull | stringCursor style when hovering.
(Inherited from Container)
eventModePixiEventModeHow the object takes part in the federated event system.
(Inherited from Container)
hitAreaIHitArea | nullHit area shape.
(Inherited from Container)
interactivebooleanWhether the object is interactive.
(Inherited from Container)
namenull | stringDisplay name.
(Inherited from Container)
parentContainerParent container.
(Inherited from Container)
renderablebooleanWhether the object is renderable.
(Inherited from Container)
rotationnumberRotation in radians.
(Inherited from Container)
sortableChildrenbooleanWhether children should be sorted by zIndex.
(Inherited from Container)
sortDirtybooleanWhether the children need sorting.
(Inherited from Container)
transformTransformTransform data.
(Inherited from Container)
visiblebooleanWhether the object is visible.
(Inherited from Container)
worldAlphanumberAlpha relative to the scene.
(Inherited from Container)
worldTransformMatrixWorld transform matrix (read-only).
(Inherited from Container)
worldVisiblebooleanWhether the object is visible in the scene (read-only).
(Inherited from Container)
xnumberX position.
(Inherited from Container)
ynumberY position.
(Inherited from Container)
zIndexnumberZ-index for sorting.
(Inherited from Container)

Methods

MethodReturnsDescription
addChild(children?)U[0]Adds one or more children to the container.
(Inherited from Container)
addChildAt(child, index)UAdds a child at a specific index.
(Inherited from Container)
destroy(options?)voidDestroys this sprite.
emit(event, args?)booleanEmits an event.
(Inherited from Container)
from(source)SpriteCreates a sprite from the given source.
getBounds(skipUpdate?, rect?)PixiRectangleReturns the bounds of the object.
(Inherited from Container)
getChildAt(index)TReturns the child at the given index.
(Inherited from Container)
getChildIndex(child)numberReturns the index of a child.
(Inherited from Container)
getLocalBounds(rect?)PixiRectangleReturns the local bounds of the object.
(Inherited from Container)
off(event, fn?, context?)thisRemoves an event listener.
(Inherited from Container)
on(event, fn, context?)thisAdds an event listener.
(Inherited from Container)
once(event, fn, context?)thisAdds a one-time event listener.
(Inherited from Container)
removeAllListeners(event?)thisRemoves all listeners for the given event.
(Inherited from Container)
removeChild(children?)U[0]Removes one or more children from the container.
(Inherited from Container)
removeChildAt(index)TRemoves the child at a specific index.
(Inherited from Container)
removeChildren(beginIndex?, endIndex?)T[]Removes children from the container.
(Inherited from Container)
setChildIndex(child, index)voidSets the index of a child.
(Inherited from Container)
sortChildren()voidSorts the children by zIndex.
(Inherited from Container)
toGlobal(position, point?, skipUpdate?)PConverts a point to global (screen) coordinates.
(Inherited from Container)
toLocal(position, from?, point?, skipUpdate?)PConverts a point to local coordinates.
(Inherited from Container)