ceramic-engine / ceramic

Cross-platform 2D framework written in Haxe that can export natively to desktop (windows, mac, linux), mobile (ios, android), web (js + webgl) and to unity projects
MIT License
263 stars 22 forks source link

[ldtk] Support pixel offsets in gridTiles and autoLayerTiles #126

Closed Gaboose closed 11 months ago

Gaboose commented 11 months ago

Pixel coordinates in gridTiles and autoLayerTiles are not always divisible by gridWidth and gridHeight. Store this offset when parsing ldtk data and add it to corresponding TilemapQuad coordinates.

This change makes these pixel offsets in auto layer rules work in ceramic: Screenshot_20231209_180209

jeremyfa commented 11 months ago

Sounds good enough to merge as is, thanks a lot for the effort! I'll probably touch the allEqual() part of the code because generics used like this can lead to problems in some targets (especially C# target), but that's minor. It will be included in next Ceramic release!