Forums

OverviewV-Play 1 Support › how to make a background img fade

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #7124

    John

    just wondering if anyone knows how to make a background img in flappy birdĀ fade to a new image..I know how to make them change instantly but I cant figure out how to fade 1 img out and fade a new one in, thanks all

    #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, 8 months ago by  Alex.
Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.

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