Comments (4)
From the Tiled format document:
id: Unique ID of the object. Each object that is placed on a map gets a unique id. Even if an object was deleted, no object gets the same ID. Can not be changed in Tiled. (since Tiled 0.11)
This is the UID returned by Object::getUID()
gid: A reference to a tile. (optional)
This is the GID/global tile ID of the object returned by Object::getTileID()
Tile global tile IDs in Tiled start at 1. 0 represents an empty tile in the map. Each tileset starts at 0, and then the tile IDs in that tileset are added to TileSet::getFirstGID()
to return the global ID of the tile in the map. I hope that makes sense. You can read more in the tileset documentation here.
I haven't considered adding support for objecttypes.xml
as I've always thought of it as more of an editor config, but I don't see why it couldn't be loaded if it is found in the same path as the current map. It should be trivial to use something like std::unordered_map
to map the type strings to the loaded properties. Pull requests are always considered!
from tmxlite.
And also tile property ?
from tmxlite.
Not sure what you mean by type rules. An object will contain its type string as stored in the map file, available via Object::getType()
. The map loader doesn't read the objecttypes.xml file as that's not part of the map, so you'll have to load that yourself.
The tile property of the object is available via Object::getTileID()
and optionally Object::getFlipFlags()
from tmxlite.
I mean that I think that many classes have properties: objects, tilesets, and individual tiles inside tileset.
Was I needed was individual tile properties. But it's ok, I found it under Tileset::Tile::getProperties()
.
But I thought objects don't have tile IDs, So what is Object::getTileID()
?
For object types, yes I mean the default properties, like a class default stored in objecttypes.xml
.
Is it planned anytime soon by chance (or will a pull request be considered) ?
I have also another question regarding IDs. I'm uncertain how GID works.
Does every ID returned by tmxlite
starts at 1? I know there is like a +1 offset convention in file but only in certain places (in .tsx
files, GIDs look like to start at 0, but Tilset::getTiles()[0].ID == 1
). I mean there is in the tileset.tsx
:
<tile id="0"></tile>
from tmxlite.
Related Issues (20)
- Error during build HOT 12
- Minimal working example for SFML? HOT 1
- Compiler error on SFMLOrthogonalLayer.hpp HOT 4
- Get Object from inside Tile element HOT 1
- SFMLOrthogonolLayer.hpp Update() Animation Error HOT 4
- Tilesets not loading tiles HOT 5
- Problem with getLayerAs for const pointers HOT 6
- Can't find package when installing using vcpkg HOT 1
- CAN SOMEONE JUST EXPLAIN HOW TO USE THIS HOT 9
- Problem with "std::localtime" in Log.hpp line 145 HOT 1
- meson.build version doesn't match git tags HOT 1
- Enough with the unsigned integers
- Map final HOT 7
- iOS HOT 1
- Add improved file loading API (feedback wanted)
- Parse object types file
- New properties constructor + property map HOT 5
- tmx::TileSet::HasTransparency() HOT 1
- Allow to use external miniz & pugixml HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tmxlite.