Documentation
¶
Overview ¶
Package tmx provides a struct for parsing the Tiled map editor's TMX map format. See http://doc.mapeditor.org/reference/tmx-map-format/ .
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct {
Encoding string `xml:"encoding,attr"`
Compression string `xml:"compression,attr"`
Text string `xml:",chardata"`
Tiles []SingleTile `xml:"tile"`
}
type ImageLayer ¶
type Layer ¶
type Layer struct {
Name string `xml:"name,attr"`
Opacity float32 `xml:"opacity,attr"`
Visible bool `xml:"visible,attr"`
Properties []Property `xml:"properties>property"`
Data Data `xml:"data"`
// The GID of each tile, in order. Use this instead of raw Data, which is cleaned up by Decode.
GIDs []int32 `xml:"-"`
}
type Map ¶
type Map struct {
XMLName xml.Name `xml:"map"`
Version string `xml:"version,attr"`
Orientation string `xml:"orientation,attr"`
Width int `xml:"width,attr"`
Height int `xml:"height,attr"`
TileWidth int `xml:"tilewidth,attr"`
TileHeight int `xml:"tileheight,attr"`
BackgroundColor string `xml:"backgroundcolor,attr"`
Properties []Property `xml:"properties>property"`
Tilesets []Tileset `xml:"tileset"`
Layers []Layer `xml:"layer"`
ObjectGroups []ObjectGroup `xml:"objectgroup"`
ImageLayers []ImageLayer `xml:"imagelayer"`
}
type Object ¶
type Object struct {
Name string `xml:"name,attr"`
Type string `xml:"type,attr"`
X int `xml:"x,attr"`
Y int `xml:"y,attr"`
Width int `xml:"width,attr"`
Height int `xml:"height,attr"`
Rotation float32 `xml:"rotation,attr"`
GID int32 `xml:"gid,attr"`
Visible bool `xml:"visible,attr"`
Properties []Property `xml:"properties>property"`
Ellipse *Ellipse `xml:"ellipse"`
Polygon string `xml:"polygon>points"`
Polylines string `xml:"polyline>points"`
}
type ObjectGroup ¶
type SingleTile ¶
type SingleTile struct {
GID int32 `xml:"gid,attr"`
}
type TileOffset ¶
type Tileset ¶
type Tileset struct {
FirstGID int32 `xml:"firstgid,attr"`
Source string `xml:"source,attr"`
Name string `xml:"name,attr"`
TileWidth int `xml:"tilewidth,attr"`
TileHeight int `xml:"tileheight,attr"`
Spacing int `xml:"spacing,attr"`
Margin int `xml:"margin,attr"`
TileOffset TileOffset `xml:"tileoffset"`
Properties []Property `xml:"properties>property"`
Image Image `xml:"image"`
TerrainTypes []Terrain `xml:"terraintypes>terrain"`
}
Click to show internal directories.
Click to hide internal directories.