fallahn / sfml-tmxloader

SFML 2.x based tmx tilemap parser for files created with Tiled tile map editor
106 stars 33 forks source link

layer->tiles doesn't give tiles from layers #63

Closed guoliang closed 8 years ago

guoliang commented 8 years ago

Hi, correct me if I'm wrong but shouldn't following code return back a vector containing the map tiles? Or how can I get the information of the tiles in a layer from a map?

for (auto layer = map.GetLayers().begin(); layer != map.GetLayers().end(); ++layer)
{
    if (layer->name == "fooLayer")
    {
       tmx::MapTiles fooTiles = layer->tiles;
       std::cout << "FooTiles = " << fooTiles.size() << std::endl;
       // result is size = 0
    }
}
fallahn commented 8 years ago

It returns a vector of tile data used specifically by the map loader for drawing. Currently tile data from Tiled itself isn't parsed (I know, it's a stupid oversight - and on the list of things for 2.0).

guoliang commented 8 years ago

Since you probably make this lib on your free time, may I just know when you expect 2.0 to be released? :)

fallahn commented 8 years ago

To be honest... I have no idea. You can see the work in progress by switching to the 'next' branch, but tile data hasn't yet been added. Contributions are welcome though!