Skip to content

Documentation / @ripl/core / RenderElement

Interface: RenderElement

Defined in: packages/core/src/context/types.ts:46

Minimal interface for any element that can be rendered and hit-tested by a context.

Properties

PropertyModifierTypeDescriptionDefined in
abstractpublicbooleanWhether the element is abstract and therefore excluded from the context's rendered-elements list.packages/core/src/context/types.ts:52
idreadonlystringUnique identifier for this element.packages/core/src/context/types.ts:48
parent?publicRenderElementParent element in the scene graph, if any.packages/core/src/context/types.ts:50
pointerEventspublicRenderElementPointerEventsWhich regions of the element respond to pointer hit testing.packages/core/src/context/types.ts:54
zIndexpublicnumberStacking order used when sorting hit-test results; higher values are prioritised.packages/core/src/context/types.ts:56

Methods

emit()

emit(type, data): void

Defined in: packages/core/src/context/types.ts:65

Emits an event of the given type carrying the given data on this element.

Parameters

ParameterType
typestring
dataany

Returns

void


getBoundingBox()?

optional getBoundingBox(local?): Box

Defined in: packages/core/src/context/types.ts:58

Returns the element's bounding box: the on-screen (world) box, or the raw local box when local is true.

Parameters

ParameterType
local?boolean

Returns

Box


has()

has(event): boolean

Defined in: packages/core/src/context/types.ts:60

Returns whether the element has any listeners registered for the given event.

Parameters

ParameterType
eventstring

Returns

boolean


intersectsWith()

intersectsWith(x, y, options?): boolean

Defined in: packages/core/src/context/types.ts:62

Tests whether the point (x, y) lies within the element, honouring its pointer-event region.

Parameters

ParameterType
xnumber
ynumber
options?Partial<RenderElementIntersectionOptions>

Returns

boolean