Forums

OverviewV-Play 1 Supportsmooth opacity animation not having an effect › Reply To: smooth opacity animation not having an effect

OverviewV-Play 1 Supportsmooth opacity animation not having an effect › Reply To: smooth opacity animation not having an effect
#5658

Alex
V-Play Team

The transitions component must be declared in the GameWindow (where the states are changed) not in the Scene. You can have a look at the MultiSceneMultiLevel tutorial (http://v-play.net/doc/howto-multi-scene-multi-level.html) or just its source code in the Examples folder of the SDK.

Furthermore you are not making use of a great feature of the state machine, the fact that it resets all PropertyChanges of a state when you leave the state.

Scene {
  id: splashScene
  opacity: 0 // invisible by default
  // ...
}
Scene {
  id: starmapScene
  opacity: 0 // invisible by default
  // ...
}

states: [
  State {
    name: "splash"
    // if the state of the GameWindow is "splash" the splashScene gets visible --> opacity to 1
    // in any other state the PropertyChange gets reset automatically --> opacity of splashScene back to 0
    PropertyChanges { target: splashScene; opacity: 1}
  },
  State {
    name: "starmap"
    // no need to reset the opacity of the splashScene here
    PropertyChanges { target: starmapScene; opacity: 1}
  }
]

Cheers,
Alex

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