Documentation / @ripl/core / RenderElement
Interface: RenderElement ​
Defined in: packages/core/src/context/types.ts:50
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:56 |
id | readonly | string | Unique identifier for this element. | packages/core/src/context/types.ts:52 |
parent? | public | RenderElement | Parent element in the scene graph, if any. | packages/core/src/context/types.ts:54 |
pointerEvents | public | RenderElementPointerEvents | Which regions of the element respond to pointer hit testing. | packages/core/src/context/types.ts:58 |
zIndex | public | number | Stacking order used when sorting hit-test results; higher values are prioritized. | packages/core/src/context/types.ts:60 |
Methods ​
emit() ​
emit(
type,data):void
Defined in: packages/core/src/context/types.ts:69
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:62
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:64
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:66
Tests whether the point (x, y), in logical space (CSS pixels relative to the context's top-left, as pointer event payloads report), lies within the element, honoring its pointer-event region.
Parameters ​
| Parameter | Type |
|---|---|
x | number |
y | number |
options? | Partial<RenderElementIntersectionOptions> |
Returns ​
boolean