/** * Register a factory function for a given Tiled object type. * When a Tiled map is loaded, objects are matched to factories using the following * priority: object class → object name → structural type ("text", "tile", "shape"). *

* Built-in structural types are: `"text"`, `"tile"`, `"shape"`. * Custom types are matched against the object's Tiled `class` or `name` property. *

* For simple cases where you just want to map a Tiled class to a constructor, * use {@link registerTiledObjectClass} instead. * @category Tilemap * @param {string} type - the object type key (built-in type or Tiled class/name) * @param {Function} factory - factory function with signature `(settings, map) => Renderable` * @example * // register a custom factory for "Spine" objects in Tiled * // (set the object class to "Spine" in Tiled, and add atlasFile/jsonFile custom properties) * registerTiledObjectFactory("Spine", (settings, map) => { * const obj = new Spine(settings.x, settings.y, settings); * obj.pos.z = settings.z; * return obj; * }); * * @example * // override the built-in "shape" factory to add custom behavior * registerTiledObjectFactory("shape", (settings, map) => { * const obj = new Renderable(settings.x, settings.y, settings.width, settings.height); * obj.pos.z = settings.z; * // add custom initialization... * return obj; * }); */ export function registerTiledObjectFactory(type: string, factory: Function): void; /** * Register a class constructor as a Tiled object factory. * When an object with a matching `class` or `name` is found in a Tiled map, * an instance of the given constructor will be created with `new Constructor(x, y, settings)`. *

* This is a convenience wrapper around {@link registerTiledObjectFactory}. * If the same class is registered twice with the same constructor, the call is silently ignored. * If a different constructor is registered for the same name, an error is thrown. *

* Note: classes registered via {@link pool.register} are also automatically registered * as Tiled object factories (unless {@link pool.autoRegisterTiled} is set to `false`). * @category Tilemap * @param {string} name - the Tiled class or object name to match * @param {Function} Constructor - class constructor with signature `(x, y, settings)` * @example * // register a custom enemy class for use in Tiled maps * // In Tiled: set the object class to "Enemy" and add custom properties * registerTiledObjectClass("Enemy", Enemy); * * @example * // equivalent to pool.register (which auto-registers for Tiled too) * pool.register("CoinEntity", CoinEntity, true); * // CoinEntity is now available both in the pool AND as a Tiled object factory */ export function registerTiledObjectClass(name: string, Constructor: Function): void; //# sourceMappingURL=TMXObjectFactory.d.ts.map