Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Cross fading backgrounds help — Gideros Forum

Cross fading backgrounds help

gianmichelegianmichele Member
edited June 2012 in General questions
Hi all, I'm pretty new here and also more of an artist than a coder.

I'm currently prototyping my first game and I have an endless game loop where I switch the background (cross fading) based on certain rules. How would you do it?

Thanks,
Gianmichele

Comments

  • ar2rsawseenar2rsawseen Maintainer
    Firstly I wouldn't do an endless loop, because it would block all UI and app would be unresponsive. Unless this is your purpose, you can try using timers, which won't block anything.
    --running timer 10 times each second should be sufficient
    local timer = Timer.new(100)
     
    timer:addEventListener(Event.TIMER, function()
    --do what you need to do in loop here
    end)
     
    --start the timer
    timer:start()
  • denizdeniz Maintainer
    Hello and welcome Gianmichele!
  • Thanks!

    I figured it out thanks to the fading star example :)

    Now on to the next challenge (game logic!)

Sign In or Register to comment.