API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classMesh

@codexo/exojs / rendering / stable

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 cacheAsBitmap — 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()`).

37
props
34
methods
9
events
Import
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 cacheAsBitmap — 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()`).

Constructors 1
new(options: MeshOptions): Mesh
Methods 34
_invalidateBoundsCascade(): void
_invalidateChildrenTransform(): void
_invalidateSubtreeTransform(): void
addFilter(filter: Filter): this
clearFilters(): this
collidesWith(target: Collidable): CollisionResponse | null
contains(x: number, y: number): boolean
destroy(): void
getBounds(): Rectangle
getGlobalTransform(): Matrix
getLocalBounds(): Rectangle
getNormals(): Vector[]
getTransform(): Matrix
intersectsWith(target: Collidable): boolean
invalidateCache(): this
inView(view: View): boolean
move(x: number, y: number): this
project(axis: Vector, result: Interval): Interval
recomputeLocalBounds(): this
removeFilter(filter: Filter): this
render(backend: RenderBackend): this
rotate(degrees: number): this
setAnchor(x: number, y: number): this
setBlendMode(blendMode: BlendModes): this
setOrigin(x: number, y: number): this
setPosition(x: number, y: number): this
setRotation(degrees: number): this
setScale(x: number, y: number): this
setSkew(x: number, y: number): this
setTint(color: Color): this
updateBounds(): this
updateParentTransform(): this
updateTransform(): this
setInternalSpriteFactory(factory: object | null): void
Properties 37
clip: boolean
clipShape: Rectangle | Geometry | null
collisionType: CollisionType
colors: Uint32Array<ArrayBufferLike> | null
cursor: string | null
draggable: boolean
flags: Flags<SceneNodeTransformFlags>
geometry: Geometry | null
indices: Uint16Array<ArrayBufferLike> | null
material: MeshMaterial | null
preserveDrawOrder: boolean
uvs: Float32Array<ArrayBufferLike> | null
vertices: Float32Array
anchor: ObservableVector
blendMode: BlendModes
cacheAsBitmap: boolean
cullable: boolean
filters: readonly Filter[]
indexCount: number
interactive: boolean
isAlignedBox: boolean
mask: MaskSource
origin: ObservableVector
parent: Container | null
pixelSnapMode: PixelSnapMode
position: ObservableVector
rotation: number
scale: ObservableVector
skewX: number
skewY: number
texture: RenderTexture | Texture | null
tint: Color
vertexCount: number
visible: boolean
x: number
y: number
zIndex: number
Events 9
onDrag: Signal<[InteractionEvent]>
onDragEnd: Signal<[InteractionEvent]>
onDragStart: Signal<[InteractionEvent]>
onPointerDown: Signal<[InteractionEvent]>
onPointerMove: Signal<[InteractionEvent]>
onPointerOut: Signal<[InteractionEvent]>
onPointerOver: Signal<[InteractionEvent]>
onPointerTap: Signal<[InteractionEvent]>
onPointerUp: Signal<[InteractionEvent]>
Source