[Resolved] Storyboard Build Problem - Using Folders to organize scenes

I am using the new storyboard implementation for the first time. I have an app that is running perfectly in the simulator but when loaded to my iPad was showing blank after flashing the Default.png.

I looked through the developer support sections and found how to run the “instruments” app from Apple but nothing came of that.

After some poking around, I found that the issue was in me placing my scenes into a separate folder called “scenes”

My folder on my desktop looks like this:

app root folder/main.lua
app root folder/scenes/title.lua
app root folder/images/background.png
etc.

I thought I might have an issue with my file naming as that seems to be the most popular solution.


ex. root folder/images/topMenu ~= root folder/images/topmenu

Turns out when i moved my mainMenu.lua file out of my “scenes” folder and into the root folder it showed up working. Before I go through my entire application to move all the scenes into the root folder, I was curious if there is anything i can do to adjust the file names in code.

I’ve seen in other languages using …/ or / before a string tells the program to look directly at a root folder.


ex. …/directory/folder/image.png OR /directory/folder/image.png

Does anybody know if there might be a solution like this? Otherwise I’ll just go back and remove all my scenes from folders and place them in the root folder directly, which i know will work. It will just take me FOREVER!!! [import]uid: 14357 topic_id: 22859 reply_id: 322859[/import]

I also want to use a folder for my storyboard scenes.

Maybe use dots instead slashes:
 
storyboard.gotoScene( “scenes.topmenu”, “fade”, 500 )

Let me know if this works for you. [import]uid: 10863 topic_id: 22859 reply_id: 91343[/import]

Don’t use the starting /

Eg;
storyboard.gotoScene( “scenes/topmenu”, “fade”, 500 )

I believe that should do it. [import]uid: 52491 topic_id: 22859 reply_id: 91414[/import]

The slash doesn’t work on your device. Use dots! [import]uid: 10863 topic_id: 22859 reply_id: 91700[/import]

Inlusion, who told you that “/” doesn’t work on iPad? Is that what you’re saying? Because that is not correct. [import]uid: 52491 topic_id: 22859 reply_id: 91866[/import]

I didn’t test it on iPad, but I assume that the Xcode Simulator simulates this correctly.

There’s no transition with a slash ( “/” ). However, it works fine with a dot ( “.” ).

By the way, i can’t test it on any device, because there are some strange problems with my developer certificate.

Corona Simulator
Version 2011.704 (2011.12.8)
Trial [import]uid: 10863 topic_id: 22859 reply_id: 91907[/import]

That’s very interesting and I’m actually going to roll back to 704 and test it this evening if I can find a little time.

Thanks for extra details RE Xcode simulator, will test that too. :slight_smile:

PS - To clarify, you’re only talking about storyboard transitions and not other instances where “/” is used, yes? [import]uid: 52491 topic_id: 22859 reply_id: 92119[/import]

Also if I use require() with a slash ( “/” ). The external file is not included. [import]uid: 10863 topic_id: 22859 reply_id: 92147[/import]

That’s a slash in the name, eg; “folder/file” and not “/folder/file” - yes?

(Just making sure - shouldn’t be using / at the start.)

Will test that too if you can let me know :slight_smile: [import]uid: 52491 topic_id: 22859 reply_id: 92323[/import]

Without the starting slash!

So, these functions don’t work:

storyboard.gotoScene( "scenes/somescene", "fade", 500 )
require( "somefolder/somefile" )

Can you confirm that? [import]uid: 10863 topic_id: 22859 reply_id: 92760[/import]

SUCCESS!

It appears that any image assets (im using png) are expected to be referred to with a /


ex. images/loading_background.png

However, when referring to .lua files periods are the expected syntax.


ex. storyboard.gotoScene(“scenes.preloader.preloader_storyboard”, “fade”, 500)

I created a new project and just ran my preloader (which is a series of animated sprite sheets) and it works perfectly. I don’t know much about what’s going on in the lua wrappers but I figure it’s and issue of how whatever is running behind the lua is parsing on the device.

Like I said, all of my code was working in the simulator, just not on the device. Now, I have it working on the device as well.

Thanks so much for your help guys. Glad we were able to solve this. Saves me TONS of time [import]uid: 14357 topic_id: 22859 reply_id: 93874[/import]

Hey guys, this got a little buried.

You got it right - not sure how I missed this but I did; http://blog.anscamobile.com/2011/10/daily-build-feature-lua-files-in-folders/

Peach :slight_smile: [import]uid: 52491 topic_id: 22859 reply_id: 96015[/import]