Composer Overlay Transitioning Too Quickly

Hi Rob,

Haha, the Luna library is actually my own set of adventure game engine functions. It’s not really necessary in this case, though. I’ll simplify the example overall and resend.

  • David

Hi Rob,

Here’s the updated example. Should be much simpler now.

Thanks!
 

  • David

The sample you sent shows a black screen for 2 seconds, then fades in the overlay over 300ms.  That’s what I see in the simulator and that’s what I see on my iPhone 6.  Just to make sure the fade was happening, I changed it to 3000ms and after 2 seconds, it faded in over 3 seconds as expected.  I see no issues here.  If the issue is that 2 second blackness, well you have a timer.performWithDelay(2000,…) in your code that calls your overlay.

Rob

Hi Rob,

Thanks for taking the time to check it out. It’s interesting that the overlay faded as expected on your iPhone 6. On my iPad Air, iPad Mini 1G, and iPhone 4S, there is a 300 ms delay, followed by the overlay instantaneously appearing on screen. This is happening in both the sample app I sent you and the full Doggins app, which I am trying to convert from Storyboard/Graphics 1.0 to Composer/Graphics 2.0 to release an update on the App Store. All of this code was totally functional in the ‘old’ way of doing things.

I put the timer in the code to ensure that the test application was fully up and running before beginning the transition. It’s not the issue.

I too have made the effect time long, and it does work, but when it finally starts, the effect is partially complete. Meaning, it’s further along than it should be, then appears to slow down and continue normally for the remaining duration of the effect.

I’m going to try to capture my iPad screen as a QuickTime video so you can see exactly what I’m talking about.

Thanks again,

  • David

Hi Rob,

Here’s a video capture of my iPad Air running the OverlayTest app I sent you. It was captured using a Lightning cable and OS X Yosemite.

Thanks!
 

  • David

What version of Corona SDK are you running?

The latest public release, 2511.

  • David

Interesting.  It only happens if the @2x images get loaded even in the Corona Simulator.  If you change the skin to any of the iPhone skins except the 6+ you will see it fade.  As soon as I pick either the iPad Air (an @2x device for you) or the iPhone 6+, it also demonstrates the problem.  When I installed it to my iPad 4, I noticed the problem there.

I did a little research and I forgot about some issues with when we load images.  We currently “lazy load” them for performance reasons (if I understand the issue correctly.)   To get around this we introduce a new API call way back with Graphics 2.0 came out that controls how we load the images. 

Add this line to the top of your main.lua:

display.setDefault( “preloadTextures”, false )

That should fix you up.

Rob

Hi Rob,

Thank you for your time and research! Really great to know that I’m not crazy and there is a real reason for this. :slight_smile: I gave the setDefault call a try, and it did indeed clear up the overlay transition problem. Unfortunately, it also introduced a host of performance issues throughout the game, which is probably why it’s not normally set to ‘false’, so I won’t be able to ship with this fix. I’ll use the workaround of extending the transition length.

I think it would be useful if this information were added to the Graphics 2.0 Migration Guide. This is the second behavior change I’ve run into (the first being a change in “shader precision,” as detailed here), and both have literally cost me many days of time trying to fix/workaround. Others would likely benefit from this information as well.

Really appreciate your help!

  • David