qml学习
精灵的使用,将一张20帧的图片动起来
Item {
width: 766
height: 822
anchors.left: parent.left
anchors.top: parent.top
anchors.topMargin: App.adaptHeight(100)
SpriteSequence {
id:spritetest
anchors.fill: parent
sprites: [
Sprite {
name: "first"
source: "图片资源1"
frameHeight: 822
frameWidth: 766
frameCount: 20
frameRate: 20
to:{"second":1}
},
Sprite {
name: "second"
source: "图片资源2"
frameHeight: 822
frameWidth: 766
frameCount: 20
frameRate: 20
to:{"third":1}
},
Sprite {
name: "third"
source: "图片资源3"
frameHeight: 822
frameWidth: 766
frameCount: 20
frameRate: 20
to:{"four":1}
},
Sprite {
name: "four"
source: "图片资源4"
frameHeight: 822
frameWidth: 766
frameCount: 15
frameRate: 20
to:{"first":1}
}
]
}
}