Sprite
Unofficial
Sprite display object.
Import:
import type { Sprite } from '@obsidian-typings/obsidian-public-latest';Signature:
export class Sprite extends ContainerExtends: Container
Properties
| Property | Type | Description | |
|---|---|---|---|
| alpha | number | Alpha (opacity). (Inherited from Container) | |
| angle | number | Rotation angle in degrees. (Inherited from Container) | |
| children | T[] | Children of this container (read-only). (Inherited from Container) | |
| cursor | null | string | Cursor style when hovering. (Inherited from Container) | |
| hitArea | IHitArea | null | Hit area shape. (Inherited from Container) | |
| interactive | boolean | Whether the object is interactive. (Inherited from Container) | |
| name | null | string | Display name. (Inherited from Container) | |
| parent | Container | Parent container. (Inherited from Container) | |
| renderable | boolean | Whether the object is renderable. (Inherited from Container) | |
| rotation | number | Rotation in radians. (Inherited from Container) | |
| sortableChildren | boolean | Whether children should be sorted by zIndex. (Inherited from Container) | |
| sortDirty | boolean | Whether the children need sorting. (Inherited from Container) | |
| transform | Transform | Transform data. (Inherited from Container) | |
| visible | boolean | Whether the object is visible. (Inherited from Container) | |
| worldAlpha | number | Alpha relative to the scene. (Inherited from Container) | |
| worldTransform | Matrix | World transform matrix (read-only). (Inherited from Container) | |
| worldVisible | boolean | Whether the object is visible in the scene (read-only). (Inherited from Container) | |
| x | number | X position. (Inherited from Container) | |
| y | number | Y position. (Inherited from Container) | |
| zIndex | number | Z-index for sorting. (Inherited from Container) |
Methods
| Method | Returns | Description | |
|---|---|---|---|
| addChild(children?) | U[0] | Adds one or more children to the container. (Inherited from Container) | |
| addChildAt(child, index) | U | Adds a child at a specific index. (Inherited from Container) | |
| destroy(options?) | void | Destroys this sprite. | |
| emit(event, args?) | boolean | Emits an event. (Inherited from Container) | |
| from(source) | Sprite | Creates a sprite from the given source. | |
| getBounds(skipUpdate?, rect?) | PixiRectangle | Returns the bounds of the object. (Inherited from Container) | |
| getChildAt(index) | T | Returns the child at the given index. (Inherited from Container) | |
| getChildIndex(child) | number | Returns the index of a child. (Inherited from Container) | |
| getLocalBounds(rect?) | PixiRectangle | Returns the local bounds of the object. (Inherited from Container) | |
| off(event, fn?, context?) | this | Removes an event listener. (Inherited from Container) | |
| on(event, fn, context?) | this | Adds an event listener. (Inherited from Container) | |
| once(event, fn, context?) | this | Adds a one-time event listener. (Inherited from Container) | |
| removeAllListeners(event?) | this | Removes 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) | T | Removes the child at a specific index. (Inherited from Container) | |
| removeChildren(beginIndex?, endIndex?) | T[] | Removes children from the container. (Inherited from Container) | |
| setChildIndex(child, index) | void | Sets the index of a child. (Inherited from Container) | |
| sortChildren() | void | Sorts the children by zIndex. (Inherited from Container) | |
| toGlobal(position, point?, skipUpdate?) | P | Converts a point to global (screen) coordinates. (Inherited from Container) | |
| toLocal(position, from?, point?, skipUpdate?) | P | Converts a point to local coordinates. (Inherited from Container) |