Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

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