Squaby Demo
import QtQuick 2.0
import Felgo 4.0
SquabySceneBase {
id: loadingScene
state: "exited"
signal finishedLoadingAnimation
MultiResolutionImage {
source: Qt.resolvedUrl("../../assets/img/bgSubmenu.png")
anchors.centerIn: parent
property int pixelFormat: 3
}
MultiResolutionImage {
id: squabyBg
source: Qt.resolvedUrl("../../assets/img/bgMainmenu.png")
anchors.centerIn: parent
}
Text {
text: "Loading..."
color: "white"
font.family: jellyFont.name
font.pixelSize: 42
x: 75
y: 50
}
function enterScene() {
state = "entered"
}
onStateChanged: console.debug("LoadingScene.state changed to", state)
Timer {
id: opacityAnimationFinishedTimer
interval: 4*opacityAnimation.duration
onTriggered: {
console.debug("finished opacity animation!?")
finishedLoadingAnimation()
}
}
states: [
State {
name: "entered"
PropertyChanges { target: squabyBg; opacity: 1 }
StateChangeScript {
script: {
opacityAnimationFinishedTimer.start()
}
}
},
State {
name: "exited"
PropertyChanges { target: squabyBg; opacity: 0 }
}
]
transitions: Transition {
NumberAnimation {
id: opacityAnimation
target: squabyBg
duration: 900
property: "opacity"
easing.type: Easing.InOutQuad