I want to create slideshow type cutscenes, and I was working on creating a crossfade effect. To make it work I need to layer images and cause the one on top to become more and more transparent.
I wrote some code that uses “get” to grab each pixel, modify its alpha, then uses “set” to put it back. You can imagine that this is fairly slow and looks less than smooth. Anyone have any idea how to modify the alpha of an entire image? I was trying to figure out some way to do it with meshes too but haven’t come up with anything.
However, why use a mesh when you can tint an image directly? For example:
function setup()
myImage = readImage("Planet Cute:Icon")
end
function draw()
background(40, 40, 50)
tint(255,255,255,math.min(ElapsedTime * 10, 255))
sprite(myImage, WIDTH/2, HEIGHT/2)
end