edoren / STP

SFML TMX Parser -
edoren.github.io/STP
Other
30 stars 13 forks source link

Displaying map objects #1

Closed xkazinx closed 10 years ago

xkazinx commented 10 years ago

I followed the example posted but I can't get the objects to be displayed. stp

edoren commented 10 years ago

Could you please add the code used, and the .tmx file also.

xkazinx commented 10 years ago

Tmx: https://drive.google.com/file/d/0BzzUiJCu8jZcVXF0UkNsaVh1SzQ/edit?usp=sharing

void main()
{
    sf::RenderWindow wnd(sf::VideoMode(640, 480), "Test"));
    tmx::TileMap map("untitled.tmx");
    map.ShowObjects(); // Display all the layer objects.

    while (wnd.isOpen())
    {
    sf::Event event;
    while (wnd.pollEvent(event))
    {
        if (event.type == sf::Event::Closed)
            wnd.close();
    }
    wnd.clear(sf::Color::Black);
    wnd.draw(map);
    wnd.display();
    }
}
edoren commented 10 years ago

Ok, thanks for report it, I will add that feature soon.