-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Closes #443 TODO: * [x] Tests Tiled and Excalibur use the same words for different things 🤦 * Tiled tileset `margin` is the same as Excalibur's `SpriteSheet.originOffset` * Tiled tileset `spacing` is the same as Excalibur's `SpriteSheet.margin` Uploaded a Tiled example that demonstrates this in the plugin <img width="320" alt="image" src="https://github.com/excaliburjs/excalibur-tiled/assets/612071/60844efe-929a-438a-9ea5-01540130d99c"> <img width="414" alt="image" src="https://github.com/excaliburjs/excalibur-tiled/assets/612071/f3daa2e1-fd2d-487e-b2bb-2146c5002933">
- Loading branch information
Showing
7 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<map version="1.10" tiledversion="1.10.1" orientation="orthogonal" renderorder="right-down" width="30" height="20" tilewidth="10" tileheight="10" infinite="0" nextlayerid="2" nextobjectid="1"> | ||
<tileset firstgid="1" name="margin" tilewidth="10" tileheight="10" spacing="10" margin="10" tilecount="100" columns="10"> | ||
<image source="assets/margin.png" width="200" height="200"/> | ||
</tileset> | ||
<layer id="1" name="Tile Layer 1" width="30" height="20"> | ||
<data encoding="csv"> | ||
1,2,1,2,1,2,1,2,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,0,0, | ||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 | ||
</data> | ||
</layer> | ||
</map> |
This file contains 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
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Thank you so much for the quick fix. I think there might still be a bug if I understand the code correctly:
In your example, both Tiled spacing and margin are 10px, so there is no difference in behavior. If they were different, Excalibur would not apply the Tiled margin on the right and bottom side, potentially allocating too many sprites per row?