feat(engine): Tiled P5 — image/group layers, iso/hex/staggered coords, Wang (#73)
- Image layers: <imagelayer> renders with parallax + optional repeatx/repeaty tiling across the view; the image loads relative to the map file. Group layers flatten at build (children render in file order); layer offset/opacity/tint are queryable (Tiled.layer_kind / layer_offsetx / layer_offsety / layer_opacity / layer_tint), a group's tint applying recursively. - Orientation transforms: Tiled.cell_x / Tiled.cell_y compute a tile cell's screen position for orthogonal, isometric ((x-y)*tw/2, (x+y)*th/2), staggered, and hexagonal (rows step by (tileh+hexsidelength)/2, alternate rows shoved per staggerindex) — the tile draw now places cells through them. - Wang: exported Wang-set GIDs are ordinary GIDs and resolve through the standard GID resolver; the terrain-corner authoring concept is editor-side (design cut). Proven by library/tiled_p5.ludic (14 assertions) over the real isometric_grass_and_water.tmx (iso + Wang) and hexagonal-mini.tmx, plus a hand-authored image+group fixture. x test: 96 passed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
b8c71d2a8e
commit
78a5719fae
15 changed files with 5829 additions and 5007 deletions
18
assets/tiled-fixtures/img_group.tmx
Normal file
18
assets/tiled-fixtures/img_group.tmx
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Hand-authored P5 fixture: image + group layers (issue #73). CC0. -->
|
||||
<map version="1.10" tiledversion="1.10.2" orientation="orthogonal" renderorder="right-down" width="4" height="4" tilewidth="16" tileheight="16" infinite="0" nextlayerid="4" nextobjectid="1">
|
||||
<tileset firstgid="1" source="anim_tiles.tsx"/>
|
||||
<imagelayer id="1" name="bg" offsetx="8" offsety="4" repeatx="1">
|
||||
<image source="../kenney/tiny-dungeon/Tilemap/tilemap.png" width="203" height="186"/>
|
||||
</imagelayer>
|
||||
<group id="2" name="grp" offsetx="16" opacity="0.5" tintcolor="#ff0000">
|
||||
<layer id="3" name="inner" width="4" height="4">
|
||||
<data encoding="csv">
|
||||
2,0,0,0,
|
||||
0,0,0,0,
|
||||
0,0,0,0,
|
||||
0,0,0,0
|
||||
</data>
|
||||
</layer>
|
||||
</group>
|
||||
</map>
|
||||
Loading…
Add table
Add a link
Reference in a new issue