Jump to content

Fade In And Fade Out (Black & White)


Xeno

Recommended Posts

I'm going to share a simple method for creating fade-in and fade-out effect. We will be using images at different opacity for this effect.

The images can be downloaded here: https://www.ascensiongamedev.com/resources/filehost/27848cc2d688cff08a6a5a175cbe7ead.zip

First create 4 switches: FadeToBlack, FadeFromBlack, FadeToWhite, FadeFromWhite

Then create 4 Common Events: FadeToBlack, FadeFromBlack, FadeToWhite, FadeFromWhite

The Common Event for FadeToBlack will look something like this: (Using pictures: black25.png etc & "Stretch To Fit")

682f1df4a0470aaeec953f445c6737b2.png

6e5fbdfc977dc4d83c560077b8ff8093.png

The FadeFromBlack common event will look like this:

56816ce4e2c652bf3e81bb37fb42420e.png

Instead of going from 25% opacity to 100%, we will be going from 100% to 25%.

89d24d319b7a05ecd4b3573c888219bf.png

For FadeToWhite & FadeFromWhite simply repeat the process using the images marked "white25.png" and so on.

Lastly, you can use this system in an event as such. Be sure to have a wait time that is equal to or greater than the fade-out time.

6dbd2cd5fd5adbbfd6bf1b3cef1b5847.png

Link to comment
Share on other sites

  • 1 year later...

It is something simple, but very effective for the aesthetics of any game.  Congratulations!

 

The only change I would make is to change the variables, instead of using 4 boolean variables, I would use 1 int variable.  And each value: 1, 2, 3, 4 would represent the created fades, 0 being the default value.  This would save variables.

Edit: I downloaded your images and tried to improve your script a little, I realized that your wait is at 1000ms, so I thought that the transition could be a little "halted" (that thought was what made me download to test)

(to make fade in and out just set to 1, wait 1000, set to 2)

So I came to the conclusion that the best to wait that you could use is the 50ms, so the fade is very fluid look:

Ps: I used only one commom event and a variable, because it is only a test, but I hope that this knowledge has added something more for you and for everyone who will read in the future

Edited by Weylon Santana
Adding a little more knowledge to my previous comment
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...