Intro fade in and out?

I cannot figure out how to make my logo fade in and then out and then change the animation and do every thing again
Dragonman Native.gdg (19.7 KB)

There are 2 way to animate an image :

  • using a sprite animation : the easier if you know a bit how to use an image editor, but need a lot of image for the animation to be smooth when it plays
  • using only one image object and changing it’s opacity, probably the best way and not so complicated.

You’ll need some variable ot do the 2nd solution, but the idea is :

  1. object opacity is > 0 then do -1 to object opacity
  2. object opacity is = 0 then do +1 to object opacity

But for doing this you have to use a variable to check if opacity is increasing or decreasing. Also keep in mind that opacity accept values from 0 to 255.

You can also imagine something smoother using something like +255*TimeDelta() to object opacity.

Check on forum, this question came really often about animation cycle with code.

I am using exact same way to do the intro but doesn’t seem to work. Please Check the attachment. (148 KB)

I’ll take a look this evenning i don’t have GDevelop right now on my computer.

Here it is, i deleted all useless thing for you to have a clear and easy example, with an optionnal action to make the logo blink forever.

I used a variable object on the “Logos” sprite.

Enjoy :slight_smile:

I’m gonna commit it on the wiki also

I have done that in a much easier way!!! I think it is easy for me… Well… I want is a complex function. object logo; animation = 0; fade in and out; object logo; animation =1; fade in and out; so on till the 3rd animation and then change the object and do it for the last time!
lastly every time enter is pressed it changes the animation and do to 0 to the opacity of the logo. and when the last object(2nd) object is faded in and out then it change the scene

Have you checked the example I send you?
If somebody is interested in another way to do it I’ll post the file here too :slight_smile: (62 KB)

Thanks! Thant was amazing :mrgreen:
But I have done it differently. And it is working