@@ -47,7 +47,7 @@ type ObjectGroup struct {
4747 // The opacity of the layer as a value from 0 to 1. Defaults to 1.
4848 Opacity float32 `xml:"opacity,attr,omitempty"`
4949 // Whether the layer is shown (1) or hidden (0). Defaults to 1.
50- Visible * bool `xml:"visible,attr"` // TODO: default to non 0 value
50+ Visible * bool `xml:"visible,attr"`
5151 // Rendering offset for this layer in pixels. Defaults to 0. (since 0.14)
5252 OffsetX int `xml:"offsetx,attr,omitempty"`
5353 // Rendering offset for this layer in pixels. Defaults to 0. (since 0.14)
@@ -82,7 +82,7 @@ type Object struct {
8282 // An reference to a tile (optional).
8383 GID uint32 `xml:"gid,attr,omitempty"`
8484 // Whether the object is shown (1) or hidden (0). Defaults to 1. (since 0.9)
85- Visible * bool `xml:"visible,attr"` // TODO: default not 0
85+ Visible * bool `xml:"visible,attr"`
8686 // Custom properties
8787 Properties * Properties `xml:"properties,omitempty"`
8888 // Used to mark an object as an ellipse. The existing x, y, width and height attributes are used to determine the size of the ellipse.
@@ -162,27 +162,27 @@ type Text struct {
162162 // The actual text
163163 Text string `xml:",chardata"`
164164 // The font family used (default: "sans-serif")
165- FontFamily string `xml:"fontfamily,attr"`
165+ FontFamily string `xml:"fontfamily,attr,omitempty "`
166166 // The size of the font in pixels (not using points, because other sizes in the TMX format are also using pixels) (default: 16)
167- Size int `xml:"pixelsize,attr"`
167+ Size int `xml:"pixelsize,attr,omitempty "`
168168 // Whether word wrapping is enabled (1) or disabled (0). Defaults to 0.
169- Wrap bool `xml:"wrap,attr"`
169+ Wrap bool `xml:"wrap,attr,omitempty "`
170170 // Color of the text in #AARRGGBB or #RRGGBB format (default: #000000)
171- Color * HexColor `xml:"color,attr"`
171+ Color * HexColor `xml:"color,attr,omitempty "`
172172 // Whether the font is bold (1) or not (0). Defaults to 0.
173- Bold bool `xml:"bold,attr"`
173+ Bold bool `xml:"bold,attr,omitempty "`
174174 // Whether the font is italic (1) or not (0). Defaults to 0.
175- Italic bool `xml:"italic,attr"`
175+ Italic bool `xml:"italic,attr,omitempty "`
176176 // Whether a line should be drawn below the text (1) or not (0). Defaults to 0.
177- Underline bool `xml:"underline,attr"`
177+ Underline bool `xml:"underline,attr,omitempty "`
178178 // Whether a line should be drawn through the text (1) or not (0). Defaults to 0.
179- Strikethrough bool `xml:"strikeout,attr"`
179+ Strikethrough bool `xml:"strikeout,attr,omitempty "`
180180 // Whether kerning should be used while rendering the text (1) or not (0). Default to 1.
181- Kerning bool `xml:"kerning,attr"`
181+ Kerning * bool `xml:"kerning,attr,omitempty "`
182182 // Horizontal alignment of the text within the object (left (default), center, right or justify (since Tiled 1.2.1))
183- HAlign string `xml:"halign,attr"`
183+ HAlign string `xml:"halign,attr,omitempty "`
184184 // Vertical alignment of the text within the object (top (default), center or bottom)
185- VAlign string `xml:"valign,attr"`
185+ VAlign string `xml:"valign,attr,omitempty "`
186186}
187187
188188// UnmarshalXML decodes a single XML element beginning with the given start element.
@@ -192,7 +192,7 @@ func (t *Text) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
192192 item := Alias {
193193 FontFamily : "sans-serif" ,
194194 Size : 16 ,
195- Kerning : true ,
195+ Kerning : b ( true ) ,
196196 HAlign : "left" ,
197197 VAlign : "top" ,
198198 Color : & HexColor {},
0 commit comments