Hello,
I noticed that the behaviour when reversing a sprite sequence isn’t as expected. I want to play a sprite forwards once. Then I want to reverse the animation back to the first frame. I’ve written a test programme using the example sprite below. I wanted the sprite to remain on the last frame but it doesn’t. Then the reverse animation isn’t smooth. Is this something possible using the Sprite
component?
Example sprite:
https://s1.construct.net/images/v675/uploads/articleuploadobject/0/images/16567/num.fw.png
Main.qml:
import Felgo 3.0
import QtQuick 2.0
App {
property bool spriteReverse
SpriteSequence {
anchors.centerIn: parent
width: parent.width / 5
height: width
running: spriteTimer.running
Sprite {
frameCount: 5
frameWidth: 80
frameHeight: 80
source: "../assets/numbers_spritesheet.png"
frameRate: frameCount / (spriteTimer.interval / 1000)
reverse: spriteReverse
}
}
Timer {
id: spriteTimer
interval: 5000
onTriggered: spriteReverse = !spriteReverse
}
AppButton {
anchors.horizontalCenter: parent.horizontalCenter
text: spriteReverse ? "count down" : "count up"
onClicked: spriteTimer.start()
}
}
Thanks,
Phil