Forums

OverviewV-Play 1 Supportevent associated with entering a scene › Reply To: event associated with entering a scene

OverviewV-Play 1 Supportevent associated with entering a scene › Reply To: event associated with entering a scene
#6305

Christian
V-Play Team

Hi Michael,

thanks for bringing up this question, you discovered a minor bug in this template & example!

To solve it, add the following to your PropertyChanges “explicit: true“.

So it should look like this:

states: [
    State {
      name: "menu"
      PropertyChanges {target: menuScene; opacity: 1}
      PropertyChanges {target: window; activeScene: menuScene; explicit: true;}
    },
    State {
      name: "selectLevel"
      PropertyChanges {target: selectLevelScene; opacity: 1}
      PropertyChanges {target: window; activeScene: selectLevelScene; explicit: true}
    },

 

This prevents the property to bounce back when the state is left. Also, I would rather use onVisibleChanged to determine if the scene was entered which is abit more efficient than checking for each opacity change.

 

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