qt - Making a sprite animation in QML -
i trying write little program, has connect internet. while doing this, app should show animation have made in flash professional , exported sprite sheet. utilize animatedsprite type in qml:
import qtquick 2.2 import qtquick.controls 1.1 applicationwindow { visible: true width: 640 height: 480 flags: qt.framelesswindowhint | qt.window color:"#00000000" title:"presenter remote" rectangle{ color:"steelblue" height:parent.height width:parent.width radius: 10 } image { anchors.right: parent.right anchors.top: parent.top anchors.topmargin: -20 scale: 0.5 source: "close.png" mousearea { width:parent.width height:parent.height onclicked: qt.quit() } } animatedsprite{ source: "animation_cloud.png" anchors.centerin: parent frameheight:313 framewidth:232 running: true framecount:60 frameduration: 20 width:232 height:313 } } when compile , launch sprite animating, moves right left while doing it.
how can set sprite still , maintain "half arrows" moving?
the problem seems sprite sheet; remove excess space right hand side of .png.
qt animation qml sprite
No comments:
Post a Comment