Documentation
¶
Index ¶
- Constants
- func DecodeContent(content string, encoding Encoding, compression Compression) ([]uint32, error)
- func ObjectAlignmentAnchor(alignment ObjectAlignment) (ax, ay float32)
- type Chunk
- type Compression
- type Data
- type DrawOrder
- type Encoding
- type FlipFlag
- type Image
- type Layer
- type LayerFlag
- type MapFlag
- type Object
- type ObjectAlignment
- type ObjectFlag
- type ObjectGroup
- type Offset
- type Orientation
- type Polygon
- type Property
- type RenderOrder
- type Tileset
- type Tmx
- type Tsx
- type Tx
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func DecodeContent ¶
func DecodeContent(content string, encoding Encoding, compression Compression) ([]uint32, error)
func ObjectAlignmentAnchor ¶ added in v0.1.4
func ObjectAlignmentAnchor(alignment ObjectAlignment) (ax, ay float32)
Types ¶
type Compression ¶
type Compression uint8
const ( CompressionNone Compression = iota CompressionGzip CompressionZlib CompressionZstd )
func (Compression) IsValid ¶
func (c Compression) IsValid() bool
func (Compression) String ¶
func (c Compression) String() string
type Data ¶
type Data struct {
Encoding Encoding `xml:"-"`
Compression Compression `xml:"-"`
Chunks []Chunk `xml:"chunk,omitempty"`
Content string `xml:",chardata"`
}
func (*Data) UnmarshalXML ¶
type Layer ¶
type Layer struct {
Width int32 `xml:"width,attr"`
Height int32 `xml:"height,attr"`
Flags LayerFlag `xml:"-"`
Data Data `xml:"data,omitempty"`
ID int32 `xml:"id,attr"`
Name string `xml:"name,attr"`
Properties []Property `xml:"properties>property,omitempty"`
}
func LayerByName ¶
func (*Layer) UnmarshalXML ¶
type Object ¶
type Object struct {
X float32 `xml:"x,attr"`
Y float32 `xml:"y,attr"`
Width float32 `xml:"width,attr,omitempty"`
Height float32 `xml:"height,attr,omitempty"`
Rotation float32 `xml:"rotation,attr,omitempty"`
Flags ObjectFlag `xml:"-"`
ID int32 `xml:"id,attr"`
GID uint32 `xml:"gid,attr,omitempty"`
Name string `xml:"name,attr,omitempty"`
Template string `xml:"template,attr,omitempty"`
Polyline Polygon `xml:"polyline,omitempty"`
Polygon Polygon `xml:"polygon,omitempty"`
Properties []Property `xml:"properties>property,omitempty"`
}
func (*Object) IsTemplate ¶
func (*Object) UnmarshalXML ¶
type ObjectAlignment ¶
type ObjectAlignment uint8
const ( ObjectAlignmentUnspecified ObjectAlignment = iota ObjectAlignmentTopLeft ObjectAlignmentTop ObjectAlignmentTopRight ObjectAlignmentLeft ObjectAlignmentCenter ObjectAlignmentRight ObjectAlignmentBottomLeft ObjectAlignmentBottom ObjectAlignmentBottomRight )
func (ObjectAlignment) IsValid ¶
func (oa ObjectAlignment) IsValid() bool
func (ObjectAlignment) String ¶
func (oa ObjectAlignment) String() string
type ObjectFlag ¶
type ObjectFlag uint8
const ( ObjectFlagVisible ObjectFlag = 1 << iota ObjectFlagTemplate )
func (ObjectFlag) IsValid ¶
func (of ObjectFlag) IsValid() bool
func (ObjectFlag) String ¶
func (of ObjectFlag) String() string
type ObjectGroup ¶
type ObjectGroup struct {
Flags LayerFlag `xml:"-"`
DrawOrder DrawOrder `xml:"-"`
ID int32 `xml:"id,attr"`
Name string `xml:"name,attr"`
Objects []Object `xml:"object,omitempty"`
Properties []Property `xml:"properties>property,omitempty"`
}
func ObjectGroupByName ¶
func ObjectGroupByName(tmx *Tmx, name string) *ObjectGroup
func (*ObjectGroup) UnmarshalXML ¶
func (og *ObjectGroup) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
type Orientation ¶
type Orientation uint8
const ( OrientationOrthogonal Orientation = iota OrientationIsometric OrientationStaggered OrientationHexagonal )
func (Orientation) IsValid ¶
func (o Orientation) IsValid() bool
func (Orientation) String ¶
func (o Orientation) String() string
type Polygon ¶ added in v0.1.4
type Polygon struct {
Points []float32 `xml:"-"` // Flat list of x,y pairs where x=Points[n], y=Points[n+1]
}
func (*Polygon) UnmarshalXML ¶ added in v0.1.4
func (*Polygon) VertexCount ¶ added in v0.1.4
type Property ¶
type Property struct {
Value string `xml:"value,attr"`
PropertyType string `xml:"propertytype,attr,omitempty"`
Name string `xml:"name,attr"`
Properties []Property `xml:"properties>property,omitempty"`
}
func PropertyByName ¶
func PropertyByType ¶
type RenderOrder ¶
type RenderOrder uint8
const ( RenderOrderRightDown RenderOrder = iota RenderOrderRightUp RenderOrderLeftDown RenderOrderLeftUp )
func (RenderOrder) IsValid ¶
func (ro RenderOrder) IsValid() bool
func (RenderOrder) String ¶
func (ro RenderOrder) String() string
type Tileset ¶
type Tmx ¶
type Tmx struct {
Width int32 `xml:"width,attr"`
Height int32 `xml:"height,attr"`
TileHeight int32 `xml:"tileheight,attr"`
TileWidth int32 `xml:"tilewidth,attr"`
Flags MapFlag `xml:"-"`
Orientation Orientation `xml:"-"`
RenderOrder RenderOrder `xml:"-"`
NextLayerID int32 `xml:"nextlayerid,attr"`
NextObjectID int32 `xml:"nextobjectid,attr"`
Tilesets []Tileset `xml:"tileset,omitempty"`
Layers []Layer `xml:"layer,omitempty"`
ObjectGroups []ObjectGroup `xml:"objectgroup,omitempty"`
Properties []Property `xml:"properties>property,omitempty"`
}
func (*Tmx) IsInfinite ¶
func (*Tmx) UnmarshalXML ¶
type Tsx ¶
type Tsx struct {
TileWidth int32 `xml:"tilewidth,attr"`
TileHeight int32 `xml:"tileheight,attr"`
TileCount int32 `xml:"tilecount,attr"`
Columns int32 `xml:"columns,attr"`
Image Image `xml:"image,omitempty"`
TileOffset Offset `xml:"tileoffset,omitempty"`
ObjectAlignment ObjectAlignment `xml:"-"`
Properties []Property `xml:"properties>property,omitempty"`
}
func (*Tsx) UnmarshalXML ¶
Click to show internal directories.
Click to hide internal directories.