Forums

OverviewV-Play 1 SupportRefresh Scene / Refresh Flickable › Reply To: Refresh Scene / Refresh Flickable

OverviewV-Play 1 SupportRefresh Scene / Refresh Flickable › Reply To: Refresh Scene / Refresh Flickable
#4331

phil.jahoda

 

Walkthrough:

– start the app

– SceneA is displayed and shows a score of 10

– we press the “entersceneBbutton” and SceneB is displayed

– we press the “changescorebutton” and change the window value to 20, and then the “backbutton”

– now, SceneA is displayed again, but my problem is, that the text still displays 10

– displaying the individual scenes is done by changing opacity, just like in Squaby

 

Example code:

main.qml

GameWindow {

id: window

property int score: 10

state: “sceneA”

SceneA {
id: sceneA
}
SceneB {
id: sceneB
}

states: [
State {
name: “sceneA”
PropertyChanges { target: sceneA; opacity: 1 }
PropertyChanges { target: sceneB; opacity: 0 }
},
State {
name: “sceneB”
PropertyChanges { target: sceneB; opacity: 1 }
PropertyChanges { target: sceneA; opacity: 0 }
}
]

}  // gamewindow end

SceneA.qml

SceneA {

Text {
id: scoredisplay
text: window.score
}
Button {
id: entersceneBbutton
onClicked: window.state = “sceneB”
}
}

SceneB.qml

SceneB {

Button {
id: changebutton
onClicked: window.score = 20;
}
Button {
id: backbutton
onClicked: window.state = “sceneA”
}
}

 

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support