Italo

unread,
Nov 12, 2015, 2:06:30 PM11/12/15
to MIT App Inventor Forum
This is an easy trick to achieve a smooth fade to black effect, (or any color you may want to use).
The secret (!?) is to use a line as thick as the canvas width that goes from the top to the bottom of it. That's right, it will cover it completely.
But we are going to change the alpha value of that line color. In my example I used a slider to allow the user to control the effect, but you can change it for a clock to make it automatic and as fast or slow as you want.
An idea that I had while doing this, is that we can change the canvas background image when the effect is 100% black and reverse the effect (fade "from" black). This will create a nice video-like transition between two different images.
If you want to try different colors, change the button's background colors ONLY. There's no need to change anything else in the blocks. 
While doing it in different colors, I realized that we can use this same effect for "tinting" images with a color.
An easy trick that offers a lot of possibilities. 






fade_black_white.aia

Taifun

unread,
Nov 12, 2015, 4:11:08 PM11/12/15
to MIT App Inventor Forum
very nice!
Taifun

Enis

unread,
Nov 13, 2015, 12:35:50 AM11/13/15
to MIT App Inventor Forum
Neat trick Italo!

Scott Ferguson

unread,
Nov 13, 2015, 11:47:15 PM11/13/15
to MIT App Inventor Forum
Cool :)
---
sf
Reply all
Reply to author
Forward
0 new messages