Transition/Easing 2.0?

Pausable transitions! Woohoo! Yes!!

Gotta’ replace my proprietary code now :slight_smile:

Guys, if you have any ideas for improvement, feedback, other functionality you want to see in future versions of Transition, please don’t hesitate to write them in a thread or in the feedback tool. The current version has been built on user feedback as well, and we would like to keep that going.

There’s gonna be a minor update soon, that sets the transition time to 500msec if no time provided (was the behaviour of T1.0), brings back the convenience method transition.dissolve, and some other improvements.

@HardBoiledIndustries: using a runtime listener removal loop on the Runtime object is really a bad idea, a lot of third-party libraries and some of ours make use of global runtime listeners (enterFrame), i can only recommend to store your created listeners in a table / global object (maybe even the storyboard object itself) and just clean those up…

alex

Here ya go :slight_smile:

http://forums.coronalabs.com/topic/39596-transition-20-easing-20-request/

All in all pretty happy with transitions (and the new easing) so just requesting some kind of distort feature.so i could distort the top and bottom widths of an image. :slight_smile:

A selector menu in my app broke with 2013.1210:

Transition 2.0:  you have to pass a display object to a transition.to call.

stack traceback:

    [C]: ?

    [C]: in function ‘error’

    ?: in function ‘to’

    …ents/Code/gitstuff/Dawnrazor/views/LevelSelector.lua:91: in function ‘cancelMove’

As far as I can tell, I am passing a display object. It’s not triggering the print statement.

[lua]

function cancelMove()

    if not thumbs[thumbNum-1] then

        print  (“It’s nil”)

    end

    tween = transition.to( thumbs[thumbNum], {time=400, x=screenW*.5, transition=easing.outExpo } )

    tween = transition.to( thumbs[thumbNum-1], {time=400, x=(screenW*.5 + padding)*-1, transition=easing.outExpo } ) – this is line 91

    tween = transition.to( thumbs[thumbNum+1], {time=400, x=screenW*1.5+padding, transition=easing.outExpo } )

end

[/lua]

Any ideas?

@Dotnaught,

You’re only checking for the existence of thumbs[thumbNum-1], but you’re doing transitions for thumbs[thumbNum] and thumbs[thumbNum+1] so maybe one of those is missing and causing your error.

@HardBoiledIndustries: using a runtime listener removal loop on the Runtime object is really a bad idea, a lot of third-party libraries and some of ours make use of global runtime listeners (enterFrame), i can only recommend to store your created listeners in a table / global object (maybe even the storyboard object itself) and just clean those up…

Yeah, I know it’s a nasty hack, but up until Transitions 2.0 it worked without issue so I left it in.  I did figure out out a way to do without it now, so the new transitions forced me to clean up my code for the better.

Thanks, I think I found the nil object…

Ha! Surely you jest. Here’s what’s breaking for me:

    transition.dissolve ( default, over, 10, 0 )

    transition.dissolve( oldBackground,gameBackground, 1000,0 )

I’ve tried doing two transitions, but so far haven’t found a combination that works correctly. Examples:

            transition.to( oldBackground,{ time=1000, alpha=0, transition=easing.inOutExpo } )

            transition.to( gameBackground, { time=1000, alpha=1, transition=easing.inOutExpo } )

            transition.from( oldBackground,{ time=1000, alpha=0, transition=easing.inOutExpo } )

            transition.to( gameBackground, { time=1000, alpha=1, transition=easing.inOutExpo } )

These do the transition, but there’s no easing.

Build 2013.1210 is breaking here with anything using transition.dissolve.

e.g. transitionStash.newTransition_433 = transition.dissolve(ham, ham2,  0, 100)

Comes up with error:

“:attempt to call field ‘dissolve’ <a nil value>”

Build 2013.1210 is throwing the

“Transition 2.0:  you have to pass a display object to a transition.to call” error in the simultator when dragging a Widget-v1 scrollview. 

Bummer for me.

Nail

I read that transition.dissolve() is temporarily missing. It will be back in a build soon.

Widget’s 1 is really old code.  We encourage people to move to Widgets 2 as that’s the supported version now.  If you’re still using Widgets 1, you probably will need to scrub through the code looking for transition calls and fix any nil references, or wait until we get a round of fixes out that takes care of a few of the defaults. 

nilling out all the transitions in the Widget 1 scrollview has seemed to stop the error. Some of the transitions were already nil’d out, but not all of them.

Nail

dupe

Hey,

I had some strange behavior of my App by changing to the actual daily build with transition 2.0. After some testing I figured out, that if you set a x/y value to an object with is currently in transition, the transition will be aborted and the object will be moved to the new coordinate immediately. Thats not the case with the old transition.

Maybe this is useful for someone. 

I found another issue: x/y values are not correct after transitions since change to 2.0. Try:

local rect = display.newRect(0, 40, 400, 320) rect:setReferencePoint(display.TopLeftReferencePoint) local function foo() print(rect.y) print(rect.x) end transition.to(rect, {time = 400,x=320, y=480, transition=easing.inExpo, onComplete = foo })

Terminal output:

479.55999755859 319.67999267578&nbsp;

Bug reported (26438)

Hi all, just a quick update. Dissolve is coming back and should be available in one of the next 1 or 2 daily builds. And @sunmils, the bug you report is being investigated as well.

Thanks,

Brent

I had problems with using slideview.lua after an update (Runtime Error regarding Transitions 2.0).

Can anyone please let me know here when the slideview.lua is working correctly with the new transitions 2.0 again?

Thx!

the problem with the slideView is, that the initImage() function is called immediately after the transition is started. transitions 2.0  has problems with that (see my post above). Simply start the function if transition is ready as onComplete.

thank you!!!

For me, i only ever use transition.to, but the timings seem to be messed up in transitions2.0

I’ve managed to tweak my code to avoid those ‘nil’ errors (and btw, I’m not transitioning any nil objects, they are always there). However on TAP events things are also going a bit haywire whereas previously they worked fine. It’s just a simple fade out and fade back in of a button if tapped, however it seems to trigger the transitions twice even though the tap is not triggered twice thereby making the code run the CLOSE and OPEN code right after each other (which seems impossible).

brag=display.newGroup();menuArea:insert(brag,true);brag.x=400;brag.y=48;brag.alpha=0

img=display.newImage(brag,assetPath … “open.png”, true);img.x=0;img.y=0

img=display.newImage(brag,assetPath … “close.png”, true);img.x=0;img.y=0;img.alpha=0

function brag:tap(event)    

     if brag.isActive==true then brag.isActive=false

         transition.to(brag,{time=100,alpha=0.5,onComplete=function(self)

                transition.to(brag,{time=100,alpha=1,onComplete=function(self)

                       – button image switches to show CLOSE

                       if self[1].alpha==1 then self[1].alpha=0;self[2].alpha=1

                       – button image switches to show OPEN

                       else self[1].alpha=1;self[2].alpha=0

                       end

                       self.isActive=true

                end})

         end})

   end

   return true

end

brag:addEventListener( “tap”, brag );brag.isActive=true