I’m already in the final stage of my app development, I had put aside the problem with the composer transitions. Now that I set out to clean the modules a bit, refine the assets and give the last details to my app I’m thinking not including @2x background image could be the cause of the strange composer transitions behavior. Try to delay but what happens is that the delay passes and then the transitions continue behaving the same. The behavior they have is the scene is fired the first time with no transition and only if it is re-entered the transitions works well.
No, it does not work well, I’m using a 768x1024 content area, zoomEven, and I thought, since the background is a blurry image, scaling up or down would not affect the App’s aesthetics at all. I only use super-light images of 768x1024px with a maximum weight of 45kb.
It feels as if when changing the scene the transition is not well appreciated because it has to load a 768x1024 image and scale it. Maybe if I have a @2x file reduce the load impact of the scene. Rather I want to understand how Corona SDK handles those loads of images.
If a composer.* scene is delayed when you try to show it, that may mean it is too busy in the create() call to show in the frame you ask it to. You may also be bogging down the system by destroying content at the same time.
I appreciate all the help. Before uploading anything, I would like to try it once more. The problem is that I can not understand how external modules work. I read this guide: https://docs.coronalabs.com/tutorial/basics/externalModules/index.html more than 20 times and I can not see it. I even managed to pass an image to another module, but when I try to use it in another module, in addition to the one I was using before, it disappears from the initial module where it is used. It’s a problem of scope, I know, could someone help me in how the images are transmitted from one module to another, especially the background images? It is not as simple as importing a batch in Photoshop. I’m sorry, I think as a graphic artist, not as a programmer.
gotoScene code
local options1 = { effect = "fromBottom", time = 100 } local function esButtonTouch( event ) --the buttons are set in a scrollView if ( event.phase == "moved" ) then dy = math.abs( event.y - event.yStart ) if ( dy \> 5 ) then ScrollView:takeFocus( event ) end elseif ( event.phase == "ended" ) then audio.play( go ) composer.gotoScene( "scenes.menu-es", options1 ) end return true end
config.lua
-- -- For more information on config.lua see the Project Configuration Guide at: -- https://docs.coronalabs.com/guide/basics/configSettings -- application = { content = { width = 768, height = 1024, scale = "zoomEven", fps = 60, imageSuffix = { ["@2x"] = 2, --["@4x"] = 4, }, }, }
I’m thinking of load the 5 backgrounds in the main.lua and making them visible in the scene “show” and invisible in the scene “hide” of each of the scenes. :D :lol: :lol: :D
@dodi - That approach could really bog down your frame rate and inflate your video memory usage. i.e. It could have serious repercussions on the performance of your game, especially on low-end devices.
First, your @2x images will only load on devices that are 1536px wide. This includes most retina iPads and perhaps some Android tablets. All current phones (that I’m aware of) are 1440px or less, so they are going to use your 1x images.
These tablets should be sufficiently powerful enough to load a 1536x2048 image quickly.
What issues are you having? I’ve read this thread several times and I’m not exactly sure what issue you’re trying to solve. Corona and almost every reasonably modern device should be powerful enough to load the right 1x or @2x image in during scene:create() for a background without causing any hiccups.
I think you mean display. Based on that I have made a small example with four composer scenes 1…4. Each scene is almost exactly the same, but calls a function in the module mod.lua to create the content in that scene.
This shows how to set up a nice composer scene file AND how to use a module to create content (including backgrounds) in scenes.
Also your transition time of 100ms is a mere 1/10th of a second which isn’t a long transition, but that transition shouldn’t start until after the scene is created. So if you’re loading your backgrounds in scene:create() it might delay the transition from starting, but once it starts, it should be smooth.
As soon as I arrive at the studio I will follow @roaminggamer instructions and keep them up to date on how the transitions behave, actually thank you very much for all your time and comments.
I want to tell you that you are a very professional programmer, wao, thanks for the example, I will keep it and study it thoroughly. I still have a lot to learn. I would practically start a new app if I try to adapt my app to your code. Thank you very much, I’m going to immerse myself in it and see how I can understand it.