API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classObjectLayer
A data-only layer of TileMapObjects - spawn points, trigger zones, collision regions, markers. Object layers are not rendered by the tile renderer; they are parsed and exposed for gameplay use (e.g. building physics colliders, placing entities). The presentation fields the source format attaches to a layer - visible, opacity, offsetX/offsetY, parallaxX/parallaxY, parallaxScale, and tintColor - are carried through in full, with any enclosing group layers' contribution already folded in, so an object layer describes the same placement and shading its neighbouring tile and image layers do. Nothing here acts on them: code that draws these objects itself is what applies them. Query with query (untyped, fully back-compatible) or, when an ObjectSchema type argument `S` is supplied, with the typed accessors byType, byKind, and where - these narrow `properties` to the developer-declared shape. The schema is **opt-in**: the default type parameter reproduces the original untyped behaviour, so `new ObjectLayer(options)` and `map.getObjectLayer('x')` are unchanged.
import { ObjectLayer } from '@codexo/exojs-tilemap'A data-only layer of TileMapObjects - spawn points, trigger zones, collision regions, markers. Object layers are not rendered by the tile renderer; they are parsed and exposed for gameplay use (e.g. building physics colliders, placing entities).
The presentation fields the source format attaches to a layer - visible, opacity, offsetX/offsetY, parallaxX/parallaxY, parallaxScale, and tintColor - are carried through in full, with any enclosing group layers' contribution already folded in, so an object layer describes the same placement and shading its neighbouring tile and image layers do. Nothing here acts on them: code that draws these objects itself is what applies them.
Query with query (untyped, fully back-compatible) or, when an ObjectSchema type argument `S` is supplied, with the typed accessors byType, byKind, and where - these narrow `properties` to the developer-declared shape. The schema is **opt-in**: the default type parameter reproduces the original untyped behaviour, so `new ObjectLayer(options)` and `map.getObjectLayer('x')` are unchanged.
new(options: ObjectLayerOptionsConstruction options for an ObjectLayer.): ObjectLayer<S>byKind(kind: K): Extract<EllipseObjectAn ellipse inscribed in `[x, y, width, height]`.<TilePropertiesAn immutable, flat key-value bag of generic tile properties. Adapters copy and freeze source properties; the runtime never retains a caller-owned mutable objec…>, { kind: K }> | Extract<PointObjectA single point at `(x, y)`.<TilePropertiesAn immutable, flat key-value bag of generic tile properties. Adapters copy and freeze source properties; the runtime never retains a caller-owned mutable objec…>, { kind: K }> | Extract<PolygonObjectA closed polygon; `points` are relative to the object origin.<TilePropertiesAn immutable, flat key-value bag of generic tile properties. Adapters copy and freeze source properties; the runtime never retains a caller-owned mutable objec…>, { kind: K }> | Extract<PolylineObjectAn open polyline; `points` are relative to the object origin.<TilePropertiesAn immutable, flat key-value bag of generic tile properties. Adapters copy and freeze source properties; the runtime never retains a caller-owned mutable objec…>, { kind: K }> | Extract<RectangleObjectAn axis-aligned rectangle object spanning `[x, y, width, height]`.<TilePropertiesAn immutable, flat key-value bag of generic tile properties. Adapters copy and freeze source properties; the runtime never retains a caller-owned mutable objec…>, { kind: K }> | Extract<TextObjectA text object carrying styled text content within `[x, y, width, height]`.<TilePropertiesAn immutable, flat key-value bag of generic tile properties. Adapters copy and freeze source properties; the runtime never retains a caller-owned mutable objec…>, { kind: K }> | Extract<TileObjectA tile (GID) object carrying a resolved tile reference. `x`/`y` are the top-left corner of the bounding box, the same convention as every other object kind. So…<TilePropertiesAn immutable, flat key-value bag of generic tile properties. Adapters copy and freeze source properties; the runtime never retains a caller-owned mutable objec…>, { kind: K }>[]getObjectById(id: number): TileMapObjectA format-independent map object. The geometry kind is the discriminant; narrow on `kind` to read shape-specific fields. Template objects are not yet represente…<TilePropertiesAn immutable, flat key-value bag of generic tile properties. Adapters copy and freeze source properties; the runtime never retains a caller-owned mutable objec…> | undefinedgetObjectByName(name: string): TileMapObjectA format-independent map object. The geometry kind is the discriminant; narrow on `kind` to read shape-specific fields. Template objects are not yet represente…<TilePropertiesAn immutable, flat key-value bag of generic tile properties. Adapters copy and freeze source properties; the runtime never retains a caller-owned mutable objec…> | undefinedquery(filter: ObjectQueryFilter for ObjectLayer.query. Unspecified fields match everything.): TileMapObjectA format-independent map object. The geometry kind is the discriminant; narrow on `kind` to read shape-specific fields. Template objects are not yet represente…<TilePropertiesAn immutable, flat key-value bag of generic tile properties. Adapters copy and freeze source properties; the runtime never retains a caller-owned mutable objec…>[]where(type: T, predicate: (object: TypedObjectA TileMapObject whose `properties` are narrowed to the schema shape declared for the object `type` `T` in schema `S`.<S, T>) => boolean): TypedObjectA TileMapObject whose `properties` are narrowed to the schema shape declared for the object `type` `T` in schema `S`.<S, T>[]class: stringdrawOrder: "index" | "topdown"id: numberkind: "object"name: stringobjects: readonly TileMapObjectA format-independent map object. The geometry kind is the discriminant; narrow on `kind` to read shape-specific fields. Template objects are not yet represente…<TilePropertiesAn immutable, flat key-value bag of generic tile properties. Adapters copy and freeze source properties; the runtime never retains a caller-owned mutable objec…>[]offsetX: numberoffsetY: numberopacity: numberparallaxScale: numberparallaxX: numberparallaxY: numbertintColor: null | numbervisible: boolean