Fade image with no mask (graphics V1)

Dear all,

I’d like to _fade _an image in space, not in time (no transitions!). In other words, I’d like to display an image on the screen that gradually fades in transparency. The result should be like this one from the masking docs:

image-mask-result2.png

Masks cannot be applied though, as my images have varying sizes.

To tell you the truth, I really don’t know where to begin with this!

Thanks & Cheers!

I’m not sure about this as i don’t have advanced graphics but I think something like this could be achived with rect.fill (image fill) and rect:setFillColor with gradient alpha. Just a thought.

Yep, I’ve tried that. But it seems that I don’t understand graphics v1.0 and gradients.

This is a simple rectangle that should fade from white to transparent, however, it gets solid white:

t = display.newRect(platform.left() + 100, platform.top(), platform.width() - 100, h) t:setFillColor({ type = "gradient", color1 = {255, 255, 255, 255}, color2 = {255, 255, 255, 0}, direction = "left" })

Am I missing something?

Ok, it was a bug with the simulator. The last daily build solved the problem, now gradients work. 

However, if I apply a gradient to an image with setFillColor won’t work, I don’t know how to make a mask without an image mask…

Well I don’t know if you are using the G1 build or just the compatibility mode.

If you can use filters than you can do it with filter.linearWipe
http://docs.coronalabs.com/guide/graphics/effects.html

I’m not sure about this as i don’t have advanced graphics but I think something like this could be achived with rect.fill (image fill) and rect:setFillColor with gradient alpha. Just a thought.

Yep, I’ve tried that. But it seems that I don’t understand graphics v1.0 and gradients.

This is a simple rectangle that should fade from white to transparent, however, it gets solid white:

t = display.newRect(platform.left() + 100, platform.top(), platform.width() - 100, h) t:setFillColor({ type = "gradient", color1 = {255, 255, 255, 255}, color2 = {255, 255, 255, 0}, direction = "left" })

Am I missing something?

Ok, it was a bug with the simulator. The last daily build solved the problem, now gradients work. 

However, if I apply a gradient to an image with setFillColor won’t work, I don’t know how to make a mask without an image mask…

Well I don’t know if you are using the G1 build or just the compatibility mode.

If you can use filters than you can do it with filter.linearWipe
http://docs.coronalabs.com/guide/graphics/effects.html