Does anyone know what the radius values of the generator.radialGradient fill mean? The 3rd and 4th values of the center_and_radiuses table do not appear to have a relation to the display object that they fill.
I can see that a value of .5 (for both) will always fill with a radius equal to the height of the object. What I can’t figure is how to fill with a radius equal to the width of the object.
For example, if you have this rectangle:
local r = display.newRect( display.actualCenterX, display.actualCenterY, 300, 100 )
This fill will fill with a radial fill equal to the height of the rectangle:
r.fill.effect = "generator.radialGradient" r.fill.effect.color1 = { 0,1,0,1 } r.fill.effect.color2 = { 1,0,0,1 } r.fill.effect.center\_and\_radiuses = { 0.8, 0.5, 0.501, 0.5 } r.fill.effect.aspectRatio = 3
What I can’t seem to determine is how to fill with the width of the rectangle. I think it is relative to the aspectRatio, but the calculation is eluding me.
Any mathematicians out there?