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

PropertyTypeDescription
alphanumberAlpha (opacity).
anglenumberRotation angle in degrees.
cursornull | stringCursor style when hovering.
eventModePixiEventModeHow the object takes part in the federated event system.
hitAreaIHitArea | nullHit area shape.
interactivebooleanWhether the object is interactive.
namenull | stringDisplay name.
parentContainerParent container.
renderablebooleanWhether the object is renderable.
rotationnumberRotation in radians.
transformTransformTransform data.
visiblebooleanWhether the object is visible.
worldAlphanumberAlpha relative to the scene.
worldTransformMatrixWorld transform matrix (read-only).
worldVisiblebooleanWhether the object is visible in the scene (read-only).
xnumberX position.
ynumberY position.
zIndexnumberZ-index for sorting.

Methods

MethodReturnsDescription
destroy(options?)voidDestroys this display object.
emit(event, args?)booleanEmits an event.
getBounds(skipUpdate?, rect?)PixiRectangleReturns the bounds of the object.
getLocalBounds(rect?)PixiRectangleReturns the local bounds of the object.
off(event, fn?, context?)thisRemoves an event listener.
on(event, fn, context?)thisAdds an event listener.
once(event, fn, context?)thisAdds a one-time event listener.
removeAllListeners(event?)thisRemoves all listeners for the given event.
toGlobal(position, point?, skipUpdate?)PConverts a point to global (screen) coordinates.
toLocal(position, from?, point?, skipUpdate?)PConverts a point to local coordinates.