Skip to content

Latest commit

History

110 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

tiled

License: MIT

Gopher Share

Loading TMX Map Format files created by the Tiled map editor into a Go struct. This package does not do anything fancy, it does not do any decoding, it unmarshalls data from .tmx and .tsx files and populates a tmx.Map struct. It updates tileset and image sources with better path information.

The TMX Map Format documentation was followed as close as possible.

A field used that is not listed in the spec is tmx.Data.InnerXML, it is the raw XML nested inside the tag <data>.

A field used that is not listed in the spec is tmx.Content, it is used to preserve the order of tmx.Map and tmx.Group elements. While building a game engine, the order of each layer in Map and Group became important.

Packages Imported

This package only uses standard libraries.

Installation

The recommended way to get started using github.com/go-stuff/tiled is by using go get to install the dependency in your project.

go get github.com/go-stuff/tiled

Usage

package main
import (
"fmt""log""github.com/go-stuff/tiled/tmx"
)
// Test loading and printing a tmx file.funcmain() {
t, err:=tmx.LoadTMX("./testdata/map.tmx")
iferr!=nil {
log.Fatal(err)
}
fmt.Println(t.String())
}

License

MIT License

About

Loading 'TMX Map Format' files created by 'Tiled' into Go structs.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages