transition.to and fill

when g2.0 was in alpha Walter had said we could transition the fill of an object. heres the code he posted.

local dir = "up" local bkgd = display.newRoundedRect( 160, 240, 200, 200, 20 ) bkgd.fill = { type="gradient", color1={ 1, 0, 0 }, color2={0, 0, 1}, direction=dir }   -- Tween first color from red to green. Note use of 255 due to bug. transition.to( bkgd.fill, { r1=0, g1=255 } )

im sure the bug has been corrected by now but is this still possible, has it been changed, or remove completely. 

i havent been able to get it to work

I’m using transition on blur, and it works. I’m doing it on a snapshot of the entire screen in this case though… There’s a little monkey business between the snapshot, and my main display group, but the syntax of the transition is the same (and the code nicely transition through some blurring). It’s a tiny bit diff than your example (.fill.effect) 

My code looks like so

[lua]

        screen.snapshot.fill.effect = “filter.pixelate”     – Blur gaussian failed on my old droid :confused:
        screen.snapshot.fill.effect.numPixels = 2
        
        local tempG = display.newGroup()    – This should be in front of the old screen now…
        tempG:insert(screen.snapshot)
        screen.TempG = tempG
        tempG:toFront()
       
       
        transition.to(screen.snapshot.fill.effect, { numPixels = 8, time = 300, transition = easing.outExpo, onComplete = function() blurDone(screen, callback) end } )

[/lua]

But it works like a champ :slight_smile:

using this code it does work but not as it should. it only changes the very top and bottom of the image

using build 2100

local bkgd = display.newRoundedRect( 240, 160, 200, 200, 20 )     bkgd.fill = { type="gradient", color1={ 1, 0, 0 }, color2={0, 0, 1}, direction="down" }           -- Tween first color from red to green. Note use of 255 due to bug.     transition.to( bkgd.fill, {time = 3000, r1=0, g1=1, b1=0, r2=1,g2=0,b2=0 } )

I’m using transition on blur, and it works. I’m doing it on a snapshot of the entire screen in this case though… There’s a little monkey business between the snapshot, and my main display group, but the syntax of the transition is the same (and the code nicely transition through some blurring). It’s a tiny bit diff than your example (.fill.effect) 

My code looks like so

[lua]

        screen.snapshot.fill.effect = “filter.pixelate”     – Blur gaussian failed on my old droid :confused:
        screen.snapshot.fill.effect.numPixels = 2
        
        local tempG = display.newGroup()    – This should be in front of the old screen now…
        tempG:insert(screen.snapshot)
        screen.TempG = tempG
        tempG:toFront()
       
       
        transition.to(screen.snapshot.fill.effect, { numPixels = 8, time = 300, transition = easing.outExpo, onComplete = function() blurDone(screen, callback) end } )

[/lua]

But it works like a champ :slight_smile:

using this code it does work but not as it should. it only changes the very top and bottom of the image

using build 2100

local bkgd = display.newRoundedRect( 240, 160, 200, 200, 20 )     bkgd.fill = { type="gradient", color1={ 1, 0, 0 }, color2={0, 0, 1}, direction="down" }           -- Tween first color from red to green. Note use of 255 due to bug.     transition.to( bkgd.fill, {time = 3000, r1=0, g1=1, b1=0, r2=1,g2=0,b2=0 } )

Has anyone actually figured this thing out?

Has anyone actually figured this thing out?