Problems with Composer when there is no ccscene

Hey Folks,

Just wanted to make you aware of a situation- maybe it’s user error, maybe it’s a bug.    I am trying to share the love of Corona with my high school students and so we are limited to working with the latest public build (because it’s free).   As a result, we don’t have access to the Composer GUI.  Even so, we can still use Composer and I would prefer to use it instead of Storyboard- for obvious reasons.  

The kids asked me to demonstrate a simple app and it turned out to be more complex than I anticipated.   They just wanted a splash screen and then to be able to move to a screen with a nav bar.  So, I created such a thing (code can be found here (I also tried attaching the code to this post): https://www.dropbox.com/s/p275pxp0ihf87f1/nphs1.zip?dl=0).   Unfortunately, it took me a couple of hours to figure out that it was a bad thing to delete the ccscene files.  

When you go to create a Composer app from the Corona Windows Simulator, you get a some sample scene files and the corresponding ccscene files.  But if you don’t have Composer GUI, you can’t really do anything with the ccscene files (or at least I’m not interested in sifting through the file to figure it out).   But if you copy the scene files and rename them, then you also need to copy the ccscene files and rename them.   To me, this is not intuitive at all.   It would be nice to skip the ccscene files altogether- Corona is growing in complexity :frowning:

Now, one might say, “Hey, you can skip the ccscene files,” but my experience tells me different.   When I deleted the ccscene files, the app ran fine in the Windows simulator, but there were display problems when I built the apk file and loaded it onto my Galaxy S5.   After I copied the original ccscene files and renamed them so they matched my new scene files, everything worked fine on the S5 device.  

Don’t know if anyone else had this experience, but it was frustrating for me and I’m hoping that someone has some thoughts about this.  

To me, things were perfect when I could make an app that only required a main.lua file (and maybe config.lua and build.settings).   Things were so simple then!

If you are wanting to use the ccscene files the top of your composer scene file will look like this:

local sceneName = ... local composer = require( "composer" ) -- Load scene with same root filename as this file local scene = composer.newScene( sceneName )

If you do NOT want to use the ccscene files the beginning of your Composer scene file will look like this:

local composer = require( "composer" ) local scene = composer.newScene( )

If you’re passing a parameter into composer.newScene it will try to load that ccscene file, otherwise it skips that and just gives you back a generic (empty) scene object.

And, you CAN just throw everything into a main.lua file and call it good. But there are real advantages to using stuff like Composer.

 Jay

Thanks Jay!  That was exactly what I was looking for.   Really appreciate your help!

To me, things were perfect when I could make an app that only required a main.lua file (and maybe config.lua and build.settings).   Things were so simple then!

If you are wanting to use the ccscene files the top of your composer scene file will look like this:

local sceneName = ... local composer = require( "composer" ) -- Load scene with same root filename as this file local scene = composer.newScene( sceneName )

If you do NOT want to use the ccscene files the beginning of your Composer scene file will look like this:

local composer = require( "composer" ) local scene = composer.newScene( )

If you’re passing a parameter into composer.newScene it will try to load that ccscene file, otherwise it skips that and just gives you back a generic (empty) scene object.

And, you CAN just throw everything into a main.lua file and call it good. But there are real advantages to using stuff like Composer.

 Jay

Thanks Jay!  That was exactly what I was looking for.   Really appreciate your help!