New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tile sheet with different sized tiles #1008

Open
Spanfile opened this Issue Jun 29, 2015 · 6 comments

Comments

Projects
None yet
5 participants
@Spanfile
Copy link

Spanfile commented Jun 29, 2015

I have a tile sheet of isometric tiles, where the tiles aren't all exactly the same size and aren't placed like tiles would be, neatly in rows and columns. For example, the "first" tile in the sheet is at coordinates 265, 1057 and is 132 pixels wide and 83 pixels tall. The next tile is at 265, 1452 and is 132 pixels wide and 99 pixels tall. Next to the sheet, I have an XML file which defines all the tile positions and sizes by their names so extracting them from the sheet is just like loading them as individual images.

Currently, Tiled wants all the tiles in the sheet to be the exact same size and be placed neatly in rows and columns in the sheet, which means I can't use my tile sheet in Tiled.

Would it be possible to add a way to read tile positions and sizes from some kind of file, such as an XML file like I currently have? It can be a proprietary Tiled file, following a Tiled format, it shouldn't be too hard converting between my XML and it. I would think it would work just like using a collection of images, but have the images come from a sheet, rather than individual files.

@bjorn bjorn added the feature label Sep 26, 2015

@bjorn bjorn changed the title Isometric tile sheet with different sized tiles Tile sheet with different sized tiles Sep 26, 2015

@brenolf

This comment has been minimized.

Copy link

brenolf commented Nov 9, 2015

👍 for this feature

@Glissando

This comment has been minimized.

Copy link

Glissando commented Nov 12, 2015

Support for texture atlases is something I've wanted for a while. I've been using multiple tilesets based on size as a workaround.

@bjorn

This comment has been minimized.

Copy link
Owner

bjorn commented Nov 12, 2015

Alright, I've added it to the Tiled roadmap where you can also vote on it: https://trello.com/b/yl3PAtN0/tiled-roadmap

One worry I have with this feature is that people will pack their images using for example TexturePacker and then use the result in Tiled. When done this way, Tiled has currently no way of numbering the tiles in a way that would remain stable in the event that the texture atlas is re-packed after images have been added/removed. For this use case, the user is expected to use the individual images in Tiled and only use the packed texture in the game, as an optimization.

The reason I still want to support this feature is mainly because it is often convenient for an artist to put related tiles on the same image, even if they have different sizes. In this case, there should be a way to tell Tiled where to find those tiles and to update that information when the image changes, without invalidating tile references.

@bjorn

This comment has been minimized.

Copy link
Owner

bjorn commented Jun 5, 2017

Also asked for on the forum.

@zyend36

This comment has been minimized.

Copy link

zyend36 commented Jan 9, 2019

@zyend36

This comment has been minimized.

Copy link

zyend36 commented Jan 9, 2019

Bjorn,

When a texture atlas is re-packed again, it may impact existing tileset and invalidate the reference.
But I believe it's the responsability of the user to relocate the tileset location in the atlas by providing the following parameters:

  • x and y offset (or margin)
  • width and height of the tile set
  • spacing if any.

If the user is using a tool such as TexturePacker, then he has the possibility to export a Json file that describe the location of each tileset in the atlas.
Therefore, if the texture is repacked he can re-enter manually the parameters above to keep the tile references valid.

Z.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment