Skip to content
/ tiled Public

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

License

Notifications You must be signed in to change notification settings

go-stuff/tiled

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.
func main() {
	t, err := tmx.LoadTMX("./testdata/map.tmx")
	if err != 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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages