Jstrahan, does your new scene load big texture atlases or lots of little textures? Big thread blocking texture atlases are likely to cause animation freezes while they load, whereas many tiny textures being loaded are less likely to be noticed on a device, and probably not noticed at all on the simulator (assuming Corona loads them one at a time while animating the rest of the game).
sorry for delay was having wisdom tooth pulled.
anyway i have 5 images either 480x480, 960x960, 1136x1136 each depending on device all running in different directions and speeds in the background. they start when app starts and never stop event though scene changes. heres a video. also runs great on devices ive tested on 5,4s,4,and 3gs
[media]
http://www.youtube.com/watch?v=XR7J41PuxEE
[/media]
How large are the textures that are loaded during the scene changes? (Not the textures that stay loaded behind the scenes)
edit: Edited because I can’t read.
video is on computer but it performs the same on device
heres a video on iphone 5 using 5 1136x1136 moving images in background. sorry for bad recording, im on meds.
[media]
[/media]
images being loaded for different scenes vary from very small (48x48) to very large (1136x1136) most large images in the ( 320x320 - 640x640 ) range
it could be the transition.to causing the problem. i’m using enterFrame for animation
Firstly, thanks for all of the responses. I’ve tried both methods but can’t get either working so here’s my code if you don’t mind taking a look to see what I’m doing wrong:
First Method"Don’t put image in the storyboard scene’s display group":
local ballImg, ballTrans local function rotateBall() ballImg.rotation = 0 ballTrans = transition.to(ballImg, {rotation=360, time=2000, onComplete=rotateBall}) end local function loadNextScene() storyboard.loadScene( "scene", false ) storyboard.gotoScene( "scene" ) end ------------------- STORYBOARD ------------------- function scene:createScene( event ) local group = self.view ballImg = display.newImageRect("/images/ballImg.png", 30.125, 30) -- POSITION ballImg.x, ballImg.y = 100, 100 end function scene:enterScene( event ) timer.performWithDelay(1, rotateBall) timer.performWithDelay(10, loadNextScene) end function scene:exitScene( event ) if ballTrans then transition.cancel(ballTrans) end end
Second Method : “Using enterFrame”:
local ballImg local function rotateBall( event ) ballImg.rotation = ballImg.rotation + 10 end local function loadNextScene() storyboard.loadScene( "scene", false ) storyboard.gotoScene( "scene" ) end ------------------- STORYBOARD ------------------- function scene:createScene( event ) ballImg = display.newImageRect("/images/ballImg.png", 30.125, 30) -- POSITION ballImg.x, ballImg.y = 100, 100 end function scene:enterScene( event ) Runtime:addEventListener("enterFrame", rotateBall) timer.performWithDelay(10, loadNextScene) end function scene:didExitScene( event ) Runtime:removeEventListener("enterFrame", rotateBall) ballImg:removeSelf() end
Try putting your rotating in a separate module
Require it in the scene
And call it when needed
Stop it in next scene
I followed your suggestion @jstrahan of putting the rotating code in it’s own module but it still froze when the heavy scene started loading.
Can you possibly share some of your working code (or create a quick demo if it’s not too much hassle)?
Sure will later tonite when I get in from work. I’ll msg you when I start to get a few details