1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
enum TextHAlign {
Left,
Center,
Right,
Justify,
}
impl Default for TextHAlign {
fn default() -> Self {
TextHAlign::Left
}
}
enum TextVAlign {
Top,
Center,
Bottom,
}
impl Default for TextVAlign {
fn default() -> Self {
TextVAlign::Top
}
}
enum Object {
Tile {
gid: usize,
},
Ellipse,
Point,
Polygon {
points: Vec<(i64, i64)>,
},
Polyline {
points: Vec<(i64, i64)>,
},
Text {
/// The font family used (defaults to “sans-serif”)
fonfamily: String,
/// The size of the font in pixels (not using points, because other sizes in the TMX format are also using pixels) (defaults to 16)
pixelsize: u32,
/// Whether word wrapping is enabled (1) or disabled (0). (defaults to 0)
wrap: bool,
/// Color of the text in #AARRGGBB or #RRGGBB format (defaults to #000000)
color: rgb::RGBA8,
/// Whether the font is bold (1) or not (0). (defaults to 0)
bold: bool,
/// Whether the font is italic (1) or not (0). (defaults to 0)
italic: bool,
/// Whether a line should be drawn below the text (1) or not (0). (defaults to 0)
underline: bool,
/// Whether a line should be drawn through the text (1) or not (0). (defaults to 0)
strikeout: bool,
/// Whether kerning should be used while rendering the text (1) or not (0). (defaults to 1)
kerning: bool,
/// Horizontal alignment of the text within the object ( left, center, right or justify, defaults to left) (since Tiled 1.2.1)
halign: TextHAlign,
/// Vertical alignment of the text within the object ( top, center or bottom, defaults to top)
valign: TextVAlign,
},
}
struct BaseObject {
object: Object,
/// Unique ID of the object. Each object that is placed on a map gets a unique id. Even if an object was deleted, no object gets the same ID. Can not be changed in Tiled. (since Tiled 0.11)
id: usize,
/// The name of the object. An arbitrary string. (defaults to “”)
name: String,
/// The type of the object. An arbitrary string. (defaults to “”)
r#type: String,
/// The x coordinate of the object in pixels. (defaults to 0)
x: u64,
/// The y coordinate of the object in pixels. (defaults to 0)
y: u64,
/// The width of the object in pixels. (defaults to 0)
width: u64,
/// The height of the object in pixels. (defaults to 0)
height: u64,
/// The rota�on of the object in degrees clockwise around (x, y). (defaults to 0)
rotation: ?,
/// Whether the object is shown (1) or hidden (0). (defaults to 1)
visible: bool,
/// A reference to a template file. (op�onal)
template: Option<String>
}
// todo ask in tiled discord if representation is ok
|