API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classMesh
Arbitrary 2D triangle-mesh primitive. `Mesh` lives alongside Sprite as a public Drawable: it has the same transform (position/rotation/scale/origin), tint, blendMode, filters, masks, and cacheAsTexture - but the geometry it renders is user-supplied rather than implied by a texture frame. The intended use cases are: - Custom-shape sprites whose silhouette isn't a quad (badges, speech bubbles, region overlays). - Deformable visuals (rope/ribbon, banner, water surface): mutate the vertex array between frames and the GPU re-tessellates nothing - only the transform changes per frame. - Particles or trails with custom geometry per emitter. The mesh data is **immutable after construction** in v1: vertex / index / UV / color arrays are exposed as readonly references. Mutate the underlying typed arrays in-place if you need per-frame updates, but the array lengths and topology cannot change. Texture is the only post-construction mutable property. The vertex stream is a flat `Float32Array` of (x, y) pairs in local space. The mesh's local bounds are computed once at construction from the AABB of those vertices and used by the cull pass. Re-computing after in-place mutation is the caller's responsibility (call `recomputeLocalBounds()`). A mesh has no declared layout box, so Drawable.anchor measures against that vertex AABB - which makes it unstable by construction. A single vertex moved outside the current hull grows the AABB and moves the pivot with it, and so does every `recomputeLocalBounds()` after a deformation. Set SceneNode.origin directly whenever the pivot has to stay put; the anchor is only a convenience for a mesh whose hull is fixed.
import { Mesh } from '@codexo/exojs'Arbitrary 2D triangle-mesh primitive.
`Mesh` lives alongside Sprite as a public Drawable: it has the same transform (position/rotation/scale/origin), tint, blendMode, filters, masks, and cacheAsTexture - but the geometry it renders is user-supplied rather than implied by a texture frame. The intended use cases are:
- Custom-shape sprites whose silhouette isn't a quad (badges, speech bubbles, region overlays). - Deformable visuals (rope/ribbon, banner, water surface): mutate the vertex array between frames and the GPU re-tessellates nothing - only the transform changes per frame. - Particles or trails with custom geometry per emitter.
The mesh data is **immutable after construction** in v1: vertex / index / UV / color arrays are exposed as readonly references. Mutate the underlying typed arrays in-place if you need per-frame updates, but the array lengths and topology cannot change. Texture is the only post-construction mutable property.
The vertex stream is a flat `Float32Array` of (x, y) pairs in local space. The mesh's local bounds are computed once at construction from the AABB of those vertices and used by the cull pass. Re-computing after in-place mutation is the caller's responsibility (call `recomputeLocalBounds()`).
A mesh has no declared layout box, so Drawable.anchor measures against that vertex AABB - which makes it unstable by construction. A single vertex moved outside the current hull grows the AABB and moves the pivot with it, and so does every `recomputeLocalBounds()` after a deformation. Set SceneNode.origin directly whenever the pivot has to stay put; the anchor is only a convenience for a mesh whose hull is fixed.
_updateOrigin(): voidblur(): thisclearFilters(): thiscollect(builder: RenderPlanBuilder, seq?: number): voidcollidesWith(target: CollidableContract for objects that participate in collision detection. Implemented by all concrete shape classes as well as `SceneNode`.): CollisionResponseResult of a successful Collidable.collidesWith call. Contains the two participating shapes, the penetration depth, containment flags, and the minimum-translati… | nullcontains(x: number, y: number): booleandestroy(): voidfocus(): thisgetBounds(out?: RectangleMutable axis-aligned rectangle defined by a top-left origin `(x, y)` and dimensions `(width, height)`. Implements Collidable with full SAT collision response f…): RectangleMutable axis-aligned rectangle defined by a top-left origin `(x, y)` and dimensions `(width, height)`. Implements Collidable with full SAT collision response f…invalidateCache(): thisinvalidateContent(): thismove(x: number, y: number): thisproject(axis: VectorConcrete mutable 2D vector with full AbstractVector arithmetic and Collidable collision support (treated as a point collider). `Vector.temp` provides a shared…, result: IntervalA closed scalar interval `[min, max]` used by the SAT collision solver to represent the projection of a shape onto a separating axis. `Interval.temp` provides…): IntervalA closed scalar interval `[min, max]` used by the SAT collision solver to represent the projection of a shape onto a separating axis. `Interval.temp` provides…recomputeLocalBounds(): thisrender(backend: RenderBackend): thisrotate(degrees: number): thissetAnchor(x: number, y: number): thissetLocalBounds(x: number, y: number, width: number, height: number): thissetOrigin(x: number, y: number): thissetPosition(x: number, y: number): thissetRotation(degrees: number): thissetScale(x: number, y: number): thissetSkew(x: number, y: number): thisupdateBounds(): thisupdateParentTransform(): thisupdateTransform(): thiscursor: null | stringdraggable: booleanfocusable: booleanname: null | stringtabIndex: numbercacheAsTexture: booleancacheResolution: TargetResolutionclip: booleanclipShape: GeometryNon-renderable geometry data object used by advanced rendering paths. Geometry owns only vertex/index data and its layout metadata; it is not a scene node, has… | RectangleMutable axis-aligned rectangle defined by a top-left origin `(x, y)` and dimensions `(width, height)`. Implements Collidable with full SAT collision response f… | nullcolors: Uint32Array<ArrayBufferLike> | nullcullable: booleandestroyed: booleanindexCount: numberinteractive: booleanisAlignedBox: booleanpreserveDrawOrder: booleanrotation: numberskewX: numberskewY: numbertexture: RenderTextureAn off-screen render target that can also be sampled as a texture. Combines RenderTarget (framebuffer attachment) with the sampler parameters of a Texture (sca… | TextureA static GPU texture sourced from an image, canvas, or video element. Holds the pixel source, its sampling state (ScaleModes, WrapModes) and its upload state (… | nulluvs: Float32Array<ArrayBufferLike> | nullvertexCount: numbervertices: Float32Arrayvisible: booleanx: numbery: numberzIndex: numberonBlur: SignalLightweight typed event emitter. Each `Signal` represents one named notification channel (e.g. `onResize`, `onFrame`). Listeners are added with Signal.add or S…<[RenderNodeSceneNode that can produce visual output. Adds the rendering pipeline features on top of the structural transform/bounds carried by SceneNode: post-process `fi…]>onContextMenu: SignalLightweight typed event emitter. Each `Signal` represents one named notification channel (e.g. `onResize`, `onFrame`). Listeners are added with Signal.add or S…<[InteractionEventDOM-Event-shaped envelope dispatched by InteractionSystem to interactive scene nodes. Bubbles up the *entire* parent chain - `target` stays pinned to the hit-d…]>onDrag: SignalLightweight typed event emitter. Each `Signal` represents one named notification channel (e.g. `onResize`, `onFrame`). Listeners are added with Signal.add or S…<[InteractionEventDOM-Event-shaped envelope dispatched by InteractionSystem to interactive scene nodes. Bubbles up the *entire* parent chain - `target` stays pinned to the hit-d…]>onDragEnd: SignalLightweight typed event emitter. Each `Signal` represents one named notification channel (e.g. `onResize`, `onFrame`). Listeners are added with Signal.add or S…<[InteractionEventDOM-Event-shaped envelope dispatched by InteractionSystem to interactive scene nodes. Bubbles up the *entire* parent chain - `target` stays pinned to the hit-d…]>onDragStart: SignalLightweight typed event emitter. Each `Signal` represents one named notification channel (e.g. `onResize`, `onFrame`). Listeners are added with Signal.add or S…<[InteractionEventDOM-Event-shaped envelope dispatched by InteractionSystem to interactive scene nodes. Bubbles up the *entire* parent chain - `target` stays pinned to the hit-d…]>onFocus: SignalLightweight typed event emitter. Each `Signal` represents one named notification channel (e.g. `onResize`, `onFrame`). Listeners are added with Signal.add or S…<[RenderNodeSceneNode that can produce visual output. Adds the rendering pipeline features on top of the structural transform/bounds carried by SceneNode: post-process `fi…]>onKeyDown: SignalLightweight typed event emitter. Each `Signal` represents one named notification channel (e.g. `onResize`, `onFrame`). Listeners are added with Signal.add or S…<[KeyEventEnvelope dispatched by `app.interaction` to the focused RenderNode for keyboard input, then bubbled up its entire parent chain - same DOM-style shape as Intera…]>onKeyUp: SignalLightweight typed event emitter. Each `Signal` represents one named notification channel (e.g. `onResize`, `onFrame`). Listeners are added with Signal.add or S…<[KeyEventEnvelope dispatched by `app.interaction` to the focused RenderNode for keyboard input, then bubbled up its entire parent chain - same DOM-style shape as Intera…]>onPointerDown: SignalLightweight typed event emitter. Each `Signal` represents one named notification channel (e.g. `onResize`, `onFrame`). Listeners are added with Signal.add or S…<[InteractionEventDOM-Event-shaped envelope dispatched by InteractionSystem to interactive scene nodes. Bubbles up the *entire* parent chain - `target` stays pinned to the hit-d…]>onPointerMove: SignalLightweight typed event emitter. Each `Signal` represents one named notification channel (e.g. `onResize`, `onFrame`). Listeners are added with Signal.add or S…<[InteractionEventDOM-Event-shaped envelope dispatched by InteractionSystem to interactive scene nodes. Bubbles up the *entire* parent chain - `target` stays pinned to the hit-d…]>onPointerOut: SignalLightweight typed event emitter. Each `Signal` represents one named notification channel (e.g. `onResize`, `onFrame`). Listeners are added with Signal.add or S…<[InteractionEventDOM-Event-shaped envelope dispatched by InteractionSystem to interactive scene nodes. Bubbles up the *entire* parent chain - `target` stays pinned to the hit-d…]>onPointerOver: SignalLightweight typed event emitter. Each `Signal` represents one named notification channel (e.g. `onResize`, `onFrame`). Listeners are added with Signal.add or S…<[InteractionEventDOM-Event-shaped envelope dispatched by InteractionSystem to interactive scene nodes. Bubbles up the *entire* parent chain - `target` stays pinned to the hit-d…]>onPointerTap: SignalLightweight typed event emitter. Each `Signal` represents one named notification channel (e.g. `onResize`, `onFrame`). Listeners are added with Signal.add or S…<[InteractionEventDOM-Event-shaped envelope dispatched by InteractionSystem to interactive scene nodes. Bubbles up the *entire* parent chain - `target` stays pinned to the hit-d…]>onPointerUp: SignalLightweight typed event emitter. Each `Signal` represents one named notification channel (e.g. `onResize`, `onFrame`). Listeners are added with Signal.add or S…<[InteractionEventDOM-Event-shaped envelope dispatched by InteractionSystem to interactive scene nodes. Bubbles up the *entire* parent chain - `target` stays pinned to the hit-d…]>