Hi,
during development of our current game, we are using SpriteSequenceFromFile with embedded Sprites for animation of the player character.
We have an animation that has to loop under a certain condition, and when the condition becomes false, the loop has to stop and another animation has to be started.
We tried this using the “to” and the “loop” property of Sprite:
“to” is set to the next animation.
“loop” would be a conditional like this:
loop: shouldLoop(player.state)
When the state changes, the loop conditional is evaluated (property binding).
But it doesn’t seem to work, it always only uses the first value the shouldLoop() returns (so it doesn’t change properly).
We also tried setting loop manually to the desired boolean value like this:
onRunningChanged: {
if(running) {
loop = shouldLoop(player.state);
}
}
This gets called and the property is changed, but the behavior of the animation does not change (it either always loops or never loops, depending on the initial value).
Is this a known problem? Is there something we can do about it?
Cheers, Chrisu