Forums

OverviewV-Play 1 Supporthow to make a background img fade › Reply To: how to make a background img fade

OverviewV-Play 1 Supporthow to make a background img fade › Reply To: how to make a background img fade
#7129

David

Hi armotechsolutions,

you can e.g. use a NumberAnimation in behavior chances (two images which will crossfade when you call crossFade():

  Image {
    id: image
    source: "somesoure"

    opacity: 0

    Behavior on opacity {
      // the cross-fade animation should last 350ms
      NumberAnimation { duration: 350 }
    }
  }

  Image {
    id: image2
    source: "somesoure"

    opacity: 1

    Behavior on opacity {
      // the cross-fade animation should last 350ms
      NumberAnimation { duration: 350 }
    }
  }

  function crossFade() {
     image.opacity = 1
     image2.opacity = 0
  }

But there are plenty of things you can do. See also this link to another approach.

Cheers,

David

  • This reply was modified 4 years, 3 months ago by  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