feat(stdlib): Tiled P4 — objects, custom props/types, templates, opt-in spawn (#72)
- Object layers: all shapes (rectangle/ellipse/point/polygon/polyline/text) and custom properties parse and are queryable — Tiled.object_count / Tiled.object / Tiled.object_shape, and Tiled.prop / prop_int / prop_type over any object / tile / layer / map. - Custom types: Tiled.load_types reads an objecttypes.xml project custom-type table so a class property resolves its default; enum values resolve as strings. - Templates: Tiled.template reads a .tx/.tj, and Tiled.load merges each object's `template` reference under the instance's overrides (field inheritance). - Opt-in spawning: Tiled.spawn / Tiled.spawn_layer map an object's class + properties onto Ludic components through the reflection ABI (Position from x/y, each property to a like-named field). Off by default — no gameplay coupling in the core load. Split into tiled_spawn.ludic, spliced only for a Tiled *game* (the world table exists only under has_ecs), so a plain map-reading tool never links against the reflection ABI. Proven by library/tiled_p4.ludic (18 assertions) incl. the design's named orthogonal-outside.tmx object shapes. x test: 95 passed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
58e1105f2d
commit
b8c71d2a8e
22 changed files with 18278 additions and 17081 deletions
14
docs/language/tiled/tiled-spawn_layer.md
Normal file
14
docs/language/tiled/tiled-spawn_layer.md
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
id: tiled-spawn_layer
|
||||
name: Tiled.spawn_layer
|
||||
category: tiled
|
||||
kind: namespace-method
|
||||
tokens: Tiled.spawn_layer
|
||||
sig: Tiled.spawn_layer(map, layer: int, model: string) -> int
|
||||
tip: Spawn every object on a layer.
|
||||
order: 29
|
||||
ns: Tiled
|
||||
member: spawn_layer
|
||||
---
|
||||
|
||||
Spawns every object on object <code>layer</code> as <code>model</code> (see <a href="tiled-spawn"><code>Tiled.spawn</code></a>); returns how many were spawned.
|
||||
Loading…
Add table
Add a link
Reference in a new issue