Repository navigation
Tiled: draw tile objects and collection tiles where Tiled draws them - #1760
Merged
Merged
Conversation
Checked against Tiled's own renderer (tmxrasterizer) on orthogonal and isometric maps, including a map built from Kenney's isometric tiles: - a tile object resized in Tiled keeps its size and its tile is stretched to fill it; it was drawn and collided at the tile's size - tile objects follow their tileset's objectalignment; they were always anchored at the bottom left (bottom center on isometric maps) - a resized or flipped tile object from an image collection is drawn on its box; its sprite kept a centered anchor that the scale and flip, applied about the top left, pushed off it - a rotated tile object turns about its alignment point, sprite and body alike; it turned about another point - animated tile objects load and play: a tileset image refused the string frame names, and an image collection had no texture (it now gets one canvas atlas holding its animation frames) - in a tile layer, collection tiles of different heights each sit on the bottom of their cell instead of being placed as tall as the tallest image Non-rotated objects and tile layers match Tiled's render pixel for pixel; melonJS's transforms match Tiled's placement rules to float precision. Every new test fails with its fix reverted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SeWCkETjW35ZbXDRswV1hx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1759. Six Tiled fixes, every one checked against Tiled's own renderer (
tmxrasterizer, Tiled 1.12.1) rather than against numbers worked out by hand.Fixes
objectalignment: tile objects are placed by their tileset's object alignment. They were always anchored at the bottom left, or the bottom center on isometric maps.alignTileObjectmoves the top left bya - R·a, so neither transform changes.addAnimationrefused the string frame names (string parameters for addAnimation are not allowed for standard spritesheet based Texture); frames are now named by position. An image collection had no texture (TypeError);TMXTileset#getAnimationTexture()builds one canvas atlas holding its animation frames.tilerendersize="tile"every tile was placed as if it were as tall as the tallest image. Collections always use the CPU path, so the fix covers every renderer.All of these are released behaviour except the
objectalignmentsupport, which is new.Verification
tmxrasterizerand by melonJS on the same TMX, then pixel-diffed. Non-rotated objects and every tile layer match pixel for pixel; master differs on roughly every drawn pixel and fails to load both animated maps. Animation frame 1 matches Tiled advanced past frame 0.subPixelon (Tiled's own render is within 0.37 px of the rules); the remaining edge differences are the two rasterizers sampling a rotated image.tmxtilemap.spec.jsandtmxrenderer.spec.js; 18 mutations (each fix reverted on its own) all fail at least one test. Full suite 8,211 passed, 10 skipped; lint and build clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01SeWCkETjW35ZbXDRswV1hx