animation/Sprite.qml (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
import QtQuick
import Quickshell
Rectangle {
width: 200
height: 200
color: "black"
SpriteSequence {
id: anim
anchors.centerIn: parent
width: 64 // frame width
height: 64 // frame height
running: true
interpolate: false
Sprite {
name: "idle"
source: "anim.png" // your spritesheet
frameCount: 6 // total number of frames
frameWidth: 64 // single frame size
frameHeight: 64
frameRate: 12 // frames per second
}
}
}
|