Is there a way to tell witch animation is currently playing? I know there is a way to tell if an animation is playing, but is there a way to return the string key of the currently playing animation? Or something like that...
so you could do something like...
if (anim.whatsplaying() == "anim1")
{
// Do something that is unique to when this animation is playing.
}
Why do you need to get the ID for the currently playing animation?
There could be a number of reasons... like....
If (_anim.whatisplaying() == "RunAway")
{
if (soundSIRIN.getStatus() == sf::Sound::Stopped)
soundSIRN.play();
}
Just simple example were you can sync animations to sounds... it would need more clean up but you get the idea... also you could key things off animations themselves...
Indeed I have already thought about this. The reason why I haven't implemented a function as proposed by aNewHobby is: What do I return if no animation is playing?
Well I guess the best idea would be to return "NULL" I suppose or something like that. Strings can be a string and completely empty as well (can't they?). I'm new to programming so I may be mistaken on that.