Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 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 7 years, 6 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.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded