Transition/Easing 2.0?

@paolo.longato: did test with:

local circle1 = display.newCircle(200, 200, 30) local circle2 = display.newCircle(200, 400, 30) local removeObjects = function( event ) display.remove(circle1); circle1 = nil display.remove(circle2); circle2 = nil print( "Triggering onComplete" ) end transition.to(circle1, {time = 2000, xScale = 2, yScale = 2, onComplete = removeObjects } ) transition.to(circle2, {time = 2000, xScale = 2, yScale = 2} )

and it works perfectly in 1225.

alex

@alexf question is: does it break in 1219?

Build 1225 seems to have resolved the issues and so far from what I can tell the transitions seem to work fine now, no more double calls after onComplete.

@paolo: I still had the errors occur in 1219, so you should definitely get 1225.

@jaques1, yes.  My question was (given that I am away from my development computer), did I isolate the “correct” problem in the first place with my pseudo-code written from a cafe’ in the middle of Copenhagen (while drinking capuccino and enjoying the sunny day)?  If so I am happy (doubly happy as it feels good to solve a problem while actually not working :slight_smile: ). 

I also remember getting warning messages saying something along the lines of: attempt to set alpha outside boundaries (and a very small negative number).  I have no idea what triggers it but I assume it was transitions (only a transition could be capable of setting alpha on objects at funny levels like -0.18334323e-5).  If “stopping time” issues are fully resolved in 1225 I bet I will not see that message anymore either :slight_smile: .

That alpha warning I have seen when transitioning alpha to 0 or 1 with a bouncing transition. Its kind of annoying. 

point in case: in 1225 you should not see it if the stopping time problem is resolved. 

The engineers have identified the download problem are working on fixing it.  It seems to only be affecting some people, hopefully this will be resolved shortly. 

When it is, I encourage everyone to pick up daily build 1225 or later as 1225 has the latest fixes to handle the nil object and time default issues.  If you do continue to post issues about Transitions 2.0 please make sure to include your build number and any details that will help us track the problem down.

EDIT: and right as I click the save button, I get a note from the engineers that the download problem should be fixed. 

Thanks

Rob

EDIT:

I’m not getting any error message, but my game no longer functions correctly as of build 1207.  it seems like it might be related to transitions since my custom scene transition effects don’t do anything, but without any error messages or feedback in the console I really have no idea what’s going wrong.  

yeps, same problem here. cant submit my apps like this.

Ah okay, that´s the reason why my current project got unplayable after the update :smiley:

Guys, could you provide some example code that breaks? Normally, there shouldn’t be any problem in terms of backwards compatibility…

Also, the docs will be available shortly.

Thanks,

Alex

Hey Alex, I got the bug as soon as I tried to perform transition.from on the event.view element inside the onRender function of a tableView 1.0 widget. I’ll try get some code as soon as I get home, but I’m sure there is an easier way to reproduce it.

Right, so i just tested transition.from with our testbed and everything is ok. I really need some example that crashes…

Thanks in advance.

Alex

Ah sorry, my bad. In my case there seemed to be an error in my code, it was just that the new library threw a fatal error when transitioning a nil object - seems like the old one didn’t :slight_smile:

Thanks for the help anyway!

With the new transition 2.0, is the transitioning of nil objects not allowed? Like Skatan said, I am seeing an error when trying to transition a nil object with the new transition 2.0.

Is this the intended function?

Thank you.

I see very strange behavior using daily build 1208.   The first scene in my app will display correctly, including showing several objects that use transition.to and transition.from, but if I try to transition to a new scene using a transition.from to pull in the next scene it fails without an error.  If I remove the transition between scenes it will switch instantly to the next scene as expected but will stop rendering the new scene as soon as it encounters an object in the new scene with a transition applied to it.  If I remove transitions on objects in the new scene it will load and display correctly.  On build 1206, prior to the transition 2.0 integration, my app works perfectly with all scene and object transitions intact.

I’m not using storyboard for scene management so it is going to be difficult for me to pull out a reproducible case, especially since there’s no crash or error displayed in the console.  It just fails silently at any transition.to or .from encountered after the first scene is displayed.  So I’m not surprised if simply using the transition.from in a simple test case doesn’t exhibit the problem.  Alex, have you tried using transitions in a multi-scened project?

I should note that I set up some custom easing functions in my main.lua, such as easing.inElastic, easing.outElastic, and easing.inOutElastic, but commenting those out didn’t fix the problem.  I use a gtween.lua library that adds some transition functionality but commenting that out didn’t fix the problem.  I use crawlspaceLib.lua but commenting out that library’s transition tweaks there didn’t fix the problem.   As far as I can tell I’m not transitioning nil objects.  Not sure what else to try.

You probably should have never been able to have transitioned a nil object.   In general, it would be really helpful to Alex and team if in addition to some code that’s not working, to also post any errors showing up in your console log.

Ok, I think I can demonstrate something similar to my problem using one of the Corona sample apps.

Load up the “Storyboard” project from the Interface Samples folder.

In scene1.lua scroll down to line 54 (after “screenGroup:insert(text3)” and add this line:

transition.from(screenGroup,{ y = -200, time = 2000})  

In daily build 1206 this will cause the scene to scroll down after the scene appears.  But in daily build 1208 the scene does not scroll down.  There is no error message in the console.

It looks like the problem is that transitions used to work on display groups, but now they don’t.

EDIT:  It’s weirder than I thought.  I put that line in the same place in all 4 scenes of that sample.  In build 1206 all 4 scenes slide in from the top using that transition.  But in build 1207 none of the scenes slide in from the top the first time through.  But when the project loops back from scene 4 to scene 1 again, scene 1 does do the scroll from top.  But the next 3 scenes still don’t scroll from top.  Weird, unexpected behavior, but similar to the problems I’m seeing in my own app.

Hey HardBoiled:: try this

 timer.performWithDelay(100, function() transition.from(screenGroup,{ y = -200, time = 2000}) end, 1)

or if you are looking for a slide-in/push-out effect then something like this…

 timer.performWithDelay(100, function() screenGroup.y = -(display.contentHeight) transition.to(screenGroup,{ y = 0, time = 2000}) end, 1)

The above is just a simple test given how you said to recreate the problem, the reason for the “do once” timer is that your example uses the corona storyboard sample and it is doing some  goofy stuff to show the various workings of storyboard.

That being said, the above code does work so I am unable to reproduce the problems you guys are having but have verified that Transition 2.0 and Easing 2.0 are working good and while I really can’t see a difference on win/apple simulator or iOS i do see a major improvement on Android where I use to “sometimes” get this lag when sliding one object to the other it now works a lot more smoother on Nexus 7 and Droid X (which are my two test devices).

Just ran with the latest daily build and found a bug with transition 2.0

They don’t work with native display objects like textField.

Got the ‘Transition 2.0:  you have to pass a display object to a transition.to call.’ error.

I commented out my textField transition and my code worked again.