Creating a Transition using Opacity

  • 10 favourites

Attached Files

The following files have been attached to this tutorial:



Download now 598.94 KB


1,010 visits, 1,268 views



This tutorial hasn't been translated.


This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Recently I made a new game and wanted to implement subtle fade in and fade out transitions. In the past I had used an example from a previous tutorial using the "Brightness" effect. However, I found the example to be a bit difficult to understand and unreliable.

After a recent re-examination of that example, I've put together an alternative solution that I believe is a far more elegant coding approach and easier to understand. In addition, I used the opacity setting rather than using the "Brightness" effect, making it work in any browser or any mobile device regardless of platform. However, you could modify this example an use the "Brightness" effect rather than using opacity by adding the "brightness" effect to each layout modifying the example I provide accordingly.

I also add a little bit of disabled code as an alternative example on how to trigger changes based on the changes of the global variable "Fade" rather than being triggered when the numeric values of the Global variable Fade_Out" are reached. Of coarse you'll have to download the capx see what I'm talking about.

I hope thisis example will also help you to understand how to manipulate numeric values of effects and other process requiring numeric values.

The capx is well commented and the code is easy to copy to any project.

Hope you enjoy it, learn from it, and find it useful!



Download now 598.94 KB

  • Order by
Want to leave a comment? Login or Register an account!