Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct { XMLName xml.Name `xml:"data"` Encoding string `xml:"encoding,attr"` Raw []byte `xml:",innerxml"` }
Data represents the data inside a Layer
type EbitenMap ¶
EbitenMap is the transformed representation of a TMX map in the simplest way possible for Ebiten to understand and render
func GetEbitenMap ¶
GetEbitenMap returns a map that Ebiten can understand based on a TMX file. Note that some data might be lost, as Ebiten does not require too much information to render a map
func GetEbitenMapFromFS ¶
GetEbitenMapFromFS allows you to pass in the file system used to find the desired file This is useful for Go's v1.16 embed package which makes it simple to embed assets into your binary and accessible via the embed.FS which is compatible with the fs.FS interface
type EbitenTileset ¶
type EbitenTileset struct { TileWidth int TileHeight int TilesetWidth int TilesetHeight int Tiles []Tile }
EbitenTileset is a friendly representation of a TSX Tileset
func GetEbitenTileset ¶
func GetEbitenTileset(path string) (*EbitenTileset, error)
GetEbitenTileset returns a simplified TSX Tileset, based on a file on disk
func GetTilesetFromFS ¶
func GetTilesetFromFS(fileSystem fs.FS, path string) (*EbitenTileset, error)
GetTilesetFromFS allows you to pass in the file system used to find the desired file This is useful for Go's v1.16 embed package which makes it simple to embed assets into your binary and accessible via the embed.FS which is compatible with the fs.FS interface
type Layer ¶
type Layer struct { XMLName xml.Name `xml:"layer"` ID string `xml:"id,attr"` Name string `xml:"name,attr"` Data Data `xml:"data"` Width int `xml:"width,attr"` Height int `xml:"height,attr"` }
Layer represents a layer in the TMX map file
type Map ¶
type Map struct { XMLName xml.Name `xml:"map"` Version string `xml:"version,attr"` TiledVersion string `xml:"tiledversion,attr"` Orientation string `xml:"orientation,attr"` RenderOrder string `xml:"renderorder,attr"` Width int `xml:"width,attr"` Height int `xml:"height,attr"` TileWidth int `xml:"tilewidth,attr"` TilHeight int `xml:"tileheight,attr"` Infinite bool `xml:"infinite,attr"` //Tileset []Tileset `xml:"tileset"` Layers []Layer `xml:"layer"` }
Map is the representation of a map in a TMX file
type Properties ¶
type Tile ¶
type Tile struct { XMLName xml.Name `xml:"tile"` Id int `xml:"id,attr"` Type string `xml:"type,attr"` Properties Properties `xml:"properties"` }
type Tileset ¶
type Tileset struct { XMLName xml.Name `xml:"tileset"` Version string `xml:"version,attr"` Name string `xml:"name,attr"` TileWidth int `xml:"tilewidth,attr"` TileHeight int `xml:"tileheight,attr"` TileCount int `xml:"tilecount,attr"` Columns int `xml:"columns,attr"` Image Image `xml:"image"` Tiles []Tile `xml:"tile"` }
Tileset represents a set of tiles in a TMX, or a TSX file