Really thinking either this is so easy I’m getting it wrong or it’s just not that easy…
I want to fill an object with a radial, rather than linear, gradient which fills from a solid (alpha = 1) to transparent (alpha = 0) pair of colours.
The code I’m looking at right now is:
local c = display.newCircle( 300, 300, 150 ) c.fill.effect = "generator.radialGradient" c.fill.effect.color1 = { .5,.5,1, 1 } c.fill.effect.color2 = { .5,.5,1, 0 } c.fill.effect.center\_and\_radiuses = { 0.5, 0.5, 0, 1 }
As you can see, color2 - as a normal fill - would make the object invisible due to an alpha of 0. Here, however, this is not happening; It appears to fill toward whichever colour is the default for the non-gradient fill (in this case, white {1,1,1}).