-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
TMX format: Support embedded images on the tileset #3841
Conversation
Previously, embedded images were only supported per-tile. Due to the recent change to use sub-rects rather than physically cutting up the tileset, when you called Tileset.loadFromImage(image), the entire tileset image would get duplicated for each tile. Now the image is embedded once at the tileset level instead. Also, the Tileset.margin and Tileset.tileSpacing properties are now writable in the scripting API. Addresses part of mapeditor#3630.
Unified the writing of "image" elements between tilesets, tiles and image layers, and made sure that embedding of images is supported everywhere. It is still only possible to create an embedded image through the scripting API, by setting an image without specifying its source.
It's a url rather than a string.
The documentation for the XML and JSON formats should probably be amended to mention the possibility of the image source being a base-64 data URL. Currently, this doesn't seem to even be described well for image collection tiles, where this has been a feature for a while. The XML documentation page mentions that an image can have |
Yes, this is accurate. Embedded images are not stored as a base-64 data URL, but re-use the "data" element also used by tile layer data. The documentation for the "data" element should be updated to mention this, though. The JSON format still does not support embedded images. I will look into supporting it and then of course will need to adjust the documentation. |
* Mention that maps and tilesets with embedded image data can be created using the JavaScript API. * Note that the <data> element can be used for both tile layer data as well as image data.
Conflicts: NEWS.md
272a39d
to
85c36fd
Compare
Previously, embedded images were only supported per-tile. Due to the recent change to use sub-rects rather than physically cutting up the tileset, when you called
Tileset.loadFromImage(image)
, the entire tileset image would get duplicated for each tile.Now the image is embedded once at the tileset level instead.
Also, the
Tileset.margin
andTileset.tileSpacing
properties are now writable in the scripting API.Addresses part of #3630.