Skip to content

DisplayObject

Unofficial

Base class for all display objects.

Import:

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

Signature:

export class DisplayObject

Properties

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

Methods

Method Returns Description
destroy(options?) void Destroys this display object.
emit(event, args?) boolean Emits an event.
getBounds(skipUpdate?, rect?) PixiRectangle Returns the bounds of the object.
getLocalBounds(rect?) PixiRectangle Returns the local bounds of the object.
off(event, fn?, context?) this Removes an event listener.
on(event, fn, context?) this Adds an event listener.
once(event, fn, context?) this Adds a one-time event listener.
removeAllListeners(event?) this Removes all listeners for the given event.
toGlobal(position, point?, skipUpdate?) P Converts a point to global (screen) coordinates.
toLocal(position, from?, point?, skipUpdate?) P Converts a point to local coordinates.