Storyboard API Questions

@RAoM_games: I wouldn’t recommend going back to an earlier build. There are other things added/changed between those builds (I’m not sure if there were any significant storyboard changes between then), so the increase in memory usage may or may not have anything to do with storyboard itself.

[import]uid: 52430 topic_id: 17828 reply_id: 72751[/import]

Add a native.textfield. Storyboard ignores them? Or is it just me?
[import]uid: 13784 topic_id: 17828 reply_id: 72810[/import]

A slide transitions question.

I am using dynamic content scaling on my app so that it will work across a wide spectrum of devices. As such, on some devices, the actual dimensions of a scene are larger than the screen area. For example, on the iphone, the actual screen area is 480x320 in landscape, but my scene background images are 540 x320.

Because my scenes are larger in dimensions that the screen dimensions, the slide transition appears to be jumpy. Instead of sliding into place gradually, a 30 pixels sliver of the new scene appears abruptly and then it starts to slide. The effect is jarring.

From what I can tell, the reason for this jumpiness is that the start X position of the next scene is based on the width of the screen. Is there a way to override this initial X positioning of the next scene?
[import]uid: 74786 topic_id: 17828 reply_id: 73573[/import]

For some reason my transitions are sliding, fading, etc like I tell them to. It’s just an instant switch. I even tried having the transition be 10 seconds long. Nothing seems to fix it.

[lua]storyboard.gotoScene(“game”, “crossFade”, 1000)[/lua]

Edit: I got it to work now. For some reason when you don’t have your display objects in the local group, the transition isn’t performed. [import]uid: 103624 topic_id: 17828 reply_id: 73850[/import]

Do local objects/variables automatically get removed when scenes are changed? So then exitScene and destoryScene would only be used for global objects/variables.

I’m confused on what I remove/stop in those functions. [import]uid: 103624 topic_id: 17828 reply_id: 74070[/import]

I started using storyboard and it runs great on the simulator, switching scenes, etc… but on the iPad I only get a black screen when I run the App. What am I doing wrong ? [import]uid: 10141 topic_id: 17828 reply_id: 74262[/import]

It runs fine on my iPhone 4 … is storyboard incompatible with iPad 2 ? [import]uid: 10141 topic_id: 17828 reply_id: 74280[/import]

It runs fine on my iPad 2 [import]uid: 88922 topic_id: 17828 reply_id: 74282[/import]

Again:

"Do local objects/variables automatically get removed when scenes are changed? So then exitScene and destoryScene would only be used for global objects/variables.

I’m confused on what I remove/stop in those functions." [import]uid: 103624 topic_id: 17828 reply_id: 74287[/import]

:-’( Any help?

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.709
The file sandbox for this project is located at the following folder:
(//Corona Simulator/app-8CBA8B4E92B2720616F3071E62580F70)
Dec 22 18:47:31local Corona Simulator[15655] : CGImageCreate: invalid image size: 0 x 0.
Dec 22 18:47:31local Corona Simulator[15655] : CGContextDrawImage: invalid context 0x0
Dec 22 18:47:31local Corona Simulator[15655] : CGBitmapContextCreateImage: invalid context 0x0
ImageIO: CGImageDestinationAddImage image parameter is nil
ImageIO: CGImageDestinationFinalize image destination does not have enough images
WARNING: Failed to find image(oldscene.jpg)
Runtime error
?:0: attempt to index a nil value
stack traceback:
[C]: ?
?: in function ‘?’
?: in function ‘gotoScene’
…opbox/Reciente/Corona SDK/app/loading.lua:29: in function ‘_listener’
?: in function <?:514>
?: in function <?:215> [import]uid: 111106 topic_id: 17828 reply_id: 75329[/import]

Are variables, functions, and other code setup in main.lua accessible from a Storyboard scene? Let’s say I have a whole series of collision filters set up in main.lua, or some common helper functions that I use throughout my game. Will these be available to external Storyboard modules, or do I have to specifically “pass” them to the new scene in the Storyboard table as shown in the documentation?

In Director, I had to make a few “common functions” non-local so external modules could access them… and that was acceptable for a few functions, but I’m fairly picky about keeping things local. I wonder how Storyboard handles this. I assume it was all coded with the local scope in mind, but when I glance at the sample code I see a fair amount of non-local functions and such (which might actually be treated as “local” in the overall scheme.

Brent Sorrentino
Ignis Design
[import]uid: 9747 topic_id: 17828 reply_id: 75334[/import]

Transition-Bug

I found the same bug as Yogamatta.

The screen size used for e.g. the “slideLeft” transition is computed from the group.
If display objects outside of the visible screen are placed in the group during “scene:createScene” the group gets bigger and the transition is off.

Very simple testcase:

Just use the “storyboard” sample code provided by Ansca.
In the file “scene2.lua” add a new display object outside the screen limits, for example:

[lua]---------------------------------------------------------------------------------

– scene2.lua


local storyboard = require( “storyboard” )
local scene = storyboard.newScene()

– Called when the scene’s view does not exist:
function scene:createScene( event )
local screenGroup = self.view

image = display.newImage( “bg2.jpg” )
screenGroup:insert( image )

– new image outside screen
testImage = display.newImage( “Icon.png” )
testImage.x = 500
testImage.y = 100
screenGroup:insert( testImage )

…[/lua]

Start the sample in the simulator and you’ll see that the transition from scene1 to scene2 is off.

The workaround to place all the offscreen elements in the enterScene listener is not good, some scenes e.g. have display objects that are shown only partially onscreen, and these need to be shown in the transition phase, too.

BTW: I like the storyboard api, thanks for this!
[import]uid: 107675 topic_id: 17828 reply_id: 75481[/import]

@ kbradford: Did you find a workaround to this problem? I’m with the same issue, transitions with blackbars.
@ jonathanbeebe: Any news about this, my friend? [import]uid: 50425 topic_id: 17828 reply_id: 75840[/import]

@maykelsb Nope, the only workaround is to use a 0 delay on transitions so the user never even sees the blackbars. It works, but it takes away one of the nice features of Storyboard. I’ve considered going back to Director until they fix some of these minor bugs. [import]uid: 84258 topic_id: 17828 reply_id: 76016[/import]

I’m now trying to combine Storyboard with the Ansca shareware package called Listview2 in order to produce one audio-book.

It would be good to have the following structure: COVER & BACKCOVER as scenes, CONTENTS MENU (from Listview2 as a scene itself), PAGESi (as scenes) from the table created at CONTENTS level.

I still have problems from linking the Storyboard’s default screenGroup to the Listview2’s default tableView. Anyone doing something similar? [import]uid: 67641 topic_id: 17828 reply_id: 76612[/import]

Has anybody achieved a true, proven “overlay” effect using the current Storyboard? I’ve tried various combinations of effects and listeners on both the “main” and the “target” module, and haven’t been able to accomplish a true overlay effect (i.e. a pause or message screen laying over the main scene without disrupting or changing the original scene).

I have tried Jon Beebe’s suggestion of the opening “overlay” and setting the “previous scene” alpha to 1.0, etc. This seems to work, but I can’t get the return (back to main scene) transition to function properly, not even by setting various scene alphas and visibilities in the different event listeners (i.e. enterScene on the “main” scene: set main scene to alpha 1.0, etc.). Going IN to the “overlay” screen seems to work… going OUT of that scene has been problematic for me. What I’m really hoping for is a “fade” effect on an overlay, not just a “snap” effect.

If Storyboard can’t achieve a true, tested, reliable “overlay” effect yet, then I will be forced to stay with Director until Storyboard can achieve this. I think this effect is immensely important to any kind of module-based transition API, without any rigging or work-arounds or otherwise. Director didn’t actually have this until around version 1.3; I added this effect with my own tweaking and eventually Ricardo added it to the core Director library. Storyboard currently doesn’t have the effect either, but I hope this is a major priority for the API in the next release.

Brent Sorrentino
Ignis Design
[import]uid: 9747 topic_id: 17828 reply_id: 76734[/import]

I’m receiving the same error Juan Luis and others are seeing:

Fri Dec 30 23:45:47 joes-imac-291.local Corona Simulator[23571] : CGImageCreate: invalid image size: 0 x 0.
Fri Dec 30 23:45:47 joes-imac-291.local Corona Simulator[23571] : CGContextDrawImage: invalid context 0x0
Fri Dec 30 23:45:47 joes-imac-291.local Corona Simulator[23571] : CGBitmapContextCreateImage: invalid context 0x0
Fri Dec 30 23:45:47 joes-imac-291.local Corona Simulator[23571] : CGImageDestinationAddImage image parameter is nil
Fri Dec 30 23:45:47 joes-imac-291.local Corona Simulator[23571] : CGImageDestinationFinalize image destination does not have enough images
WARNING: Failed to find image(oldscene.jpg)



oldscene.jpg?? What the heck is going on here?

Nick [import]uid: 114441 topic_id: 17828 reply_id: 76740[/import]

@drfate1:

I found the error in the createScene must add at least one element to the group stage.
See if you feel the same … [import]uid: 111106 topic_id: 17828 reply_id: 76743[/import]

Hey Juan Luis,

Thanks for your help, that fixed the problem!

Nick [import]uid: 114441 topic_id: 17828 reply_id: 76932[/import]

¡Cool! [import]uid: 111106 topic_id: 17828 reply_id: 76977[/import]