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

MapObject setVisible ? #57

Closed
SupaJosh opened this issue Feb 8, 2016 · 3 comments
Closed

MapObject setVisible ? #57

SupaJosh opened this issue Feb 8, 2016 · 3 comments

Comments

@SupaJosh
Copy link

SupaJosh commented Feb 8, 2016

Hi,
Since i'm newbie with TmxLoader, I dunno how it is supposed to work but :

for (auto& layer : layers)
{
    if (layer.type == tmx::ObjectGroup)
    {
        for (auto& obj : layer.objects)
        {
            if (layer.name == "Collectable")
            {
                if (obj.Contains(animatedSprite.getPosition()))
                {
                   std::cout << "Test";
                   obj.SetVisible(false);
                }
            }
        }
    }
}

I've got the "Test" text in my cmd, but the object is still visible on the map, I really don't know what to think about it?
If anyone has suggestions, it would be really appreciated ! :)

@fallahn
Copy link
Owner

fallahn commented Feb 8, 2016

Unfortunately this is a bug

@SupaJosh
Copy link
Author

SupaJosh commented Feb 8, 2016

Ok, thanks for your answer !
Sounds like I'm gonna have to draw every collectible objects as sprites o.o

@fallahn fallahn closed this as completed Feb 8, 2016
@fallahn
Copy link
Owner

fallahn commented Apr 2, 2016

fwiw I've pushed the fix of this to the 'next' branch if anyone would like to test it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants