summaryrefslogtreecommitdiff
path: root/src/lowlevel/image.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lowlevel/image.rs')
-rw-r--r--src/lowlevel/image.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/lowlevel/image.rs b/src/lowlevel/image.rs
new file mode 100644
index 0000000..5374b8c
--- /dev/null
+++ b/src/lowlevel/image.rs
@@ -0,0 +1,28 @@
+use rgb::RGB8;
+
+pub enum ImageSource {
+ External {
+ /// The reference to the tileset image file (Tiled supports most common image formats). Only used if the image is not embedded.
+ source: String,
+ },
+
+ /// Embedded images with a data child element
+ ///
+ /// Note that it is not currently possible to use Tiled to create maps with embedded image data, even though the TMX format supports this
+ Embedded {
+ /// . Valid values are file extensions like png, gif, jpg, bmp, etc.
+ format: String,
+ data: super::data::EncodedData,
+ },
+}
+
+pub struct Image {
+ pub source: ImageSource,
+ /// Defines a specific color that is treated as transparent (example value: “#FF00FF” for magenta).
+ /// Including the “#” is optional and Tiled leaves it out for compatibility reasons. (optional)
+ pub transparent_color: Option<RGB8>,
+ /// The image width in pixels (optional, used for tile index correction when the image changes)
+ pub width: Option<usize>,
+ /// The image height in pixels (optional)
+ pub height: Option<usize>,
+}