Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new readme #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
## go-tmx - Go library that reads Tiled's TMX files

[![godoc](http://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/salviati/go-tmx/tmx)

A Go library that reads Tiled's TMX files, as described by http://doc.mapeditor.org/reference/tmx-map-format/

## Installing

$ go get github.com/salviati/go-tmx/tmx

You can use `go get -u` to update the package.

## Basic Usage:

```go
package main

import (
"fmt"
"os"

"github.com/salviati/go-tmx/tmx"
)

const mapPath = "maps/sampleMap.tmx" // path to your map

func main() {
r, err := os.Open(mapPath)

if err != nil {
fmt.Println("Error reading file")
os.Exit(1)
}

gameMap, err := tmx.Read(r) // tmx parsing

if err != nil {
fmt.Println("Error parsing map")
os.Exit(2)
}

fmt.Print(gameMap) // there we go! map ready!
}

```

## Documentation

For docs, see https://godoc.org/github.com/salviati/go-tmx/tmx or run:

$ godoc github.com/salviati/go-tmx/tmx


## Test data info

testdata/tiles.png: See http://opengameart.org/content/16x16-tiles for more information about the license of this file.
2 changes: 1 addition & 1 deletion tmx/README
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
A Go library that reads Tiled's TMX files, as described by https://github.com/bjorn/tiled/wiki/TMX-Map-Format
A Go library that reads Tiled's TMX files, as described by http://doc.mapeditor.org/reference/tmx-map-format/

testdata/tiles.png: See http://opengameart.org/content/16x16-tiles for more information about the license of this file.