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
#4335

Christian
V-Play Team

In the source code you posted, those 2 buttons are on the same position on top of each other. I tried your setting and modified it so they are below each other, and the text modification works without any issues:

import VPlay 1.0
import QtQuick 1.1

GameWindow {

  id: window

  property int score: 10

  state: "sceneA"


  Scene {
    id: sceneA

    Text {
      id: scoredisplay
      text: window.score
      color: "red"
      anchors.centerIn: parent
    }
    SimpleButton {
      id: entersceneBbutton
      text: "Switch to stateB"
      onClicked: window.state = "sceneB"
    }

  }

  Scene {
    id: sceneB
    Column {
      Button {
        id: changebutton
        text: "switch score to 20"
        onClicked: window.score = 20;
      }
      SimpleButton {
        id: backbutton
        text: "Switch to stateA"
        onClicked: window.state = "sceneA"
      }
    }
  }

  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

Side note: please use the Code button to insert QML code.

Cheers, Chris

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