Hello,
I need to fix following:
I have an animation that play when i Touch a Button. But its looping when i hold the touch on my Button. I dont wanna that, the animation should play once and should not depends how long i hold the touch. I find answers with Keys but i need to know with Touch functions, there are not many to find in the net.
Here is my code piece:
if(animation == true){
if(animationClock.getElapsedTime().asSeconds() > 0.1)
{
animRec.x ++;
if(animRec.x * 103 >= animationTexture.getSize().x)
animRec.x = 0;
animationClock.restart();
}
}
FloatRect buttonRect = animationSprite.getGlobalBounds();
// the Touch is pressed the button
if(buttonRect.contains(worldPos)){
animation = true;
}
else
{
if(animRec.x * 412<= animationTexture.getSize().x)
{
animation = false;
}
}