salviati / go-tmx Goto Github PK
View Code? Open in Web Editor NEWA Go library that reads Tiled's TMX files
A Go library that reads Tiled's TMX files
Hello! I've started looking around at several TMX file loaders, and I've noticed that a lot of them (this one included) don't load external tilesets that maps / layers use.
Is there a reason for this, or is it just a missing implementation? And how would one do this with go-tmx?
Thanks for any assistance!
TMX format has been updated since go-tmx was written in 2012, and all attributes introduced since then are missing.
Thanks for sharing your work, but if can help me fix below out of your time :)
As you can see below Im using 2 layers for Tiled.
Because I have added 2nd layer of collision
<layer id="2" name="collision" width="12" height="12">
If I delete the 2nd layer (collision layer), it works as expected below:
TMX file: https://pastebin.com/57NTfEYG
in example/tmx2console/util.go,line 13
//next line,tmx.Prpperties can not found ,and don't go build.
func GetProperty(p *tmx.Properties, name string) (value string, err error) {
values := p.Get(name)
if len(values) > 1 {
err = PropertyNotUnique
return
}
if len(value) == 0 {
err = PropertyUnavailable
return
}
value = values[0]
return
}
How to get tile by X and Y?
My layer 0 contains my game meta data, all sprites in this layer will block movement.
log.Print(maps[p.Map].Layers[0])
But how i can do it? Can i get by X and Y?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.