Documentation
¶
Index ¶
- func GetImageFromFilePath(filePath string, filesystem fs.FS) *ebiten.Image
- type Data
- type Frame
- type GroupLayer
- type ImageDefinition
- type Layer
- type NodeExists
- type Point
- type Polygon
- type Property
- type Tile
- type TileMap
- func (tileMap *TileMap) Draw(screen *ebiten.Image)
- func (tileMap *TileMap) GetDimensions() (int, int)
- func (tileMap *TileMap) GetGroupLayerByName(name string) *GroupLayer
- func (tileMap *TileMap) GetLayerByName(name string) *Layer
- func (tileMap *TileMap) GetObjectGroupByName(name string) *TileMapObjectGroup
- func (tileMap *TileMap) GetTileSetByTileId(id int) (*TileSet, int)
- func (tileMap *TileMap) Update()
- type TileMapObject
- type TileMapObjectGroup
- type TileSet
- type TileSetDefinition
- type TileSetObject
- type TileSetObjectGroup
- type TileSetObjectType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Data ¶
func (*Data) UnmarshalXML ¶
type GroupLayer ¶
type GroupLayer struct {
XMLName xml.Name `xml:"group"`
Name string `xml:"name,attr"`
Layers []Layer `xml:"layer"`
ObjectGroups []TileMapObjectGroup `xml:"objectgroup"`
GroupLayers []GroupLayer `xml:"group"`
Properties []Property `xml:"properties>property"`
Tilemap *TileMap
}
func (*GroupLayer) Draw ¶
func (groupLayer *GroupLayer) Draw(screen *ebiten.Image)
func (*GroupLayer) UnmarshalXML ¶
func (gl *GroupLayer) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
type ImageDefinition ¶
type Layer ¶
type Layer struct {
XMLName xml.Name `xml:"layer"`
Id int `xml:"id,attr"`
Name string `xml:"name,attr"`
Width int `xml:"width,attr"`
Height int `xml:"height,attr"`
Properties []Property `xml:"properties>property"`
Data Data `xml:"data"`
Tilemap *TileMap
}
func (*Layer) UnmarshalXML ¶
type NodeExists ¶
type NodeExists struct {
}
type Polygon ¶
func (*Polygon) UnmarshalXML ¶
type TileMap ¶
type TileMap struct {
XMLName xml.Name `xml:"map"`
Version string `xml:"version,attr"`
TiledVersion string `xml:"tiledversion,attr"`
Path string
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"`
TileHeight int `xml:"tileheight,attr"`
Infinite bool `xml:"infinite,attr"`
TileSets []TileSetDefinition `xml:"tileset"`
GroupLayers []GroupLayer `xml:"group"`
Layers []Layer `xml:"layer"`
ObjectGroups []TileMapObjectGroup `xml:"objectgroup"`
Properties []Property `xml:"properties>property"`
AllCollisions []*TileSetObject
// contains filtered or unexported fields
}
func OpenTileMap ¶
This opens a .tmx file based on the current working directory.
An example call would looke like: etiled.OpenTileMap("assets/tilemap/base.tmx")
func (*TileMap) GetDimensions ¶
func (*TileMap) GetGroupLayerByName ¶
func (tileMap *TileMap) GetGroupLayerByName(name string) *GroupLayer
func (*TileMap) GetLayerByName ¶
func (*TileMap) GetObjectGroupByName ¶
func (tileMap *TileMap) GetObjectGroupByName(name string) *TileMapObjectGroup
func (*TileMap) GetTileSetByTileId ¶
type TileMapObject ¶
type TileMapObjectGroup ¶
type TileMapObjectGroup struct {
XMLName xml.Name `xml:"objectgroup"`
Id int `xml:"id,attr"`
Name string `xml:"name,attr"`
Properties []Property `xml:"properties>property"`
Objects []TileMapObject `xml:"object"`
Tilemap *TileMap
}
func (*TileMapObjectGroup) Draw ¶
func (objectGroup *TileMapObjectGroup) Draw(screen *ebiten.Image)
func (*TileMapObjectGroup) GetId ¶
func (o *TileMapObjectGroup) GetId() string
func (*TileMapObjectGroup) UnmarshalXML ¶
func (o *TileMapObjectGroup) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
type TileSet ¶
type TileSet struct {
XMLName xml.Name `xml:"tileset"`
Version string `xml:"version,attr"`
TiledVersion string `xml:"tiledversion,attr"`
Name string `xml:"name,attr"`
Path string
TileWidth int `xml:"tilewidth,attr"`
TileHeight int `xml:"tileheight,attr"`
TileCount int `xml:"tilecount,attr"`
Columns int `xml:"columns,attr"`
Image ImageDefinition `xml:"image"`
Properties []Property `xml:"properties>property"`
Tiles []Tile `xml:"tile"`
}
func (*TileSet) GetTileById ¶
type TileSetDefinition ¶
type TileSetObject ¶
type TileSetObject struct {
XMLName xml.Name `xml:"object"`
Id int `xml:"id,attr"`
X float64 `xml:"x,attr"`
Y float64 `xml:"y,attr"`
Name string `xml:"name,attr"`
Type string `xml:"type,attr"`
Width *float64 `xml:"width,attr"`
Height *float64 `xml:"height,attr"`
Visible *bool `xml:"visible,attr"`
IsPoint *NodeExists `xml:"point"`
IsEllipse *NodeExists `xml:"ellipse"`
Polygon *Polygon `xml:"polygon"`
Properties []Property `xml:"properties>property"`
}
func (*TileSetObject) GetType ¶
func (o *TileSetObject) GetType() TileSetObjectType
type TileSetObjectGroup ¶
type TileSetObjectType ¶
type TileSetObjectType int
const ( POINT TileSetObjectType = iota ELLIPSE POLYGON RECTANGLE )
Click to show internal directories.
Click to hide internal directories.