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

Alex
V-Play Team
import VPlay 1.0
import QtQuick 1.1

GameWindow {
  id: gameWindow
  width: 960
  height: 640

  state: "splash"

  states: [
    State {
      name: "splash"
      PropertyChanges { target: splashScene; opacity: 1}
    },
    State {
      name: "starmap"
      PropertyChanges { target: starmapScene; opacity: 1}
    }
  ]

  onStateChanged: console.log("HUD: switched to state '", state, "'")

  transitions: [
    Transition {
      NumberAnimation {
        property: "opacity"
        easing.type: Easing.InOutQuad
        duration: 10000
      }
    }
  ]

  Scene {
    id: splashScene
    width: 480
    height: 320
    opacity: 0
    Rectangle {
      color: "green"
      anchors.fill: parent
    }
    MouseArea {
      anchors.fill: parent
      onClicked: {
          console.log("onClick called")
          gameWindow.state = "starmap"
      }
    }
    Text {
      anchors.centerIn: parent
      text: "Path to Orion"
      font.pixelSize: 18
      color: "white"
    }
  }

  Scene {
    id: starmapScene
    opacity: 0
    width: 480
    height: 320
    Rectangle {
      color: "red"
      anchors.fill: parent
    }
  }
}

This is my Code that works fine.

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