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
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
abstract | public | boolean | Whether the element is abstract and therefore excluded from the context's rendered-elements list. | packages/core/src/context/types.ts:52 |
id | readonly | string | Unique identifier for this element. | packages/core/src/context/types.ts:48 |
parent? | public | RenderElement | Parent element in the scene graph, if any. | packages/core/src/context/types.ts:50 |
pointerEvents | public | RenderElementPointerEvents | Which regions of the element respond to pointer hit testing. | packages/core/src/context/types.ts:54 |
zIndex | public | number | Stacking 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
| Parameter | Type |
|---|---|
type | string |
data | any |
Returns
void
getBoundingBox()?
optionalgetBoundingBox(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
| Parameter | Type |
|---|---|
local? | boolean |
Returns
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
| Parameter | Type |
|---|---|
event | string |
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
| Parameter | Type |
|---|---|
x | number |
y | number |
options? | Partial<RenderElementIntersectionOptions> |
Returns
boolean