Storyboard API Questions

Yes, that’s exactly what I’m seeing! I can’t use any of the transitions because of this transparency issue.

Are there any solutions out there? :-\ [import]uid: 82003 topic_id: 17828 reply_id: 85061[/import]

I filed a bug for this transparency issue (Case #12053). Hopefully we’ll get a response soon :slight_smile: [import]uid: 82003 topic_id: 17828 reply_id: 85064[/import]

@ dale7, I got a response back from Ansca regarding the transparency bug. It’s not very promising :frowning:

“The reason this happens is because the transition effect is performed via a screen capture to JPEG and JPEGs do not support transparency. You can work-around this issue by providing a solid background for every scene. It’s okay to put images on top of the background with transparency because their transparent parts will not be turned black, but the background itself needs to be solid with the way it is currently implemented.” [import]uid: 82003 topic_id: 17828 reply_id: 85230[/import]

what about displaying images in this order

top

image A with alpha
image B with alpha
background image without alpha
black fill for full screen

bottom

Its still invalid even in 740. Top image during fading out its partially transparent:

http://imageshack.us/photo/my-images/825/samplez.png/

Regards
Tom [import]uid: 111283 topic_id: 17828 reply_id: 85370[/import]

In storyboard, do I have to remove the group like this?

function scene:exitScene( event )  
 local group = self.view -- Does this remove the group?  
 group:removeSelf() -- Or do I have to do it like this too?  
 group = nil  
end  

Or the same for this?

function scene:destroyScene( event )  
 local group = self.view -- Does this remove the group?  
 group:removeSelf() -- Or do I have to do it like this too?  
 group = nil  
end  

So would all objects added to the group get removed without calling removeSelf()? [import]uid: 34126 topic_id: 17828 reply_id: 85418[/import]

For those who are programming for Android devices, I’ve found an issue with handling the hardware back key in storyboard, and a semi-solution. If you handle the hardware back key in multiple scenes to go back to the previous scene, it seems that the back key event also happens in the scene you change to. After a lot of pain, I realized it was not because the event listener was remaining between scenes as I thought, but that it was being created, in ‘enterScene’ and receiving the back key ‘up’ event that happened in the other scene. I assume this is because it happens in the same ‘enterFrame’ event.
I did find a simple way to fix this and that is to use the following in ‘enterScene’:

timer.performWithDelay( 1, addKeyEvent )

Where addKeyEvent is a function that creates the event listener for the key. Even that 1ms delay keeps that event from happening when the user presses the back key on the frame that calls this one. You still have to make sure to remove the event listener in ‘exitScene’.

Any suggestions to a reason why this is necessary or corrections to my methods would be welcomed. [import]uid: 44607 topic_id: 17828 reply_id: 85903[/import]

Is it good practice to use [lua] purgeScene [/lua] once transitioned to the new scene or leave it in memory so not having the overhead of having to recreate it? [import]uid: 103970 topic_id: 17828 reply_id: 86495[/import]

Theoretically the storyboard module will call the purgeScene method when memory is needed, however, it is still being worked on. I would say that you should try allowing the storyboard module to do the memory management for you unless you run in to issues. Or you could try it both ways if you like and see which works better for you. [import]uid: 44607 topic_id: 17828 reply_id: 86500[/import]

Would it be possible to set a flag or add a function that does a transition without doing the screen copy (or whatever it is) of the old screen before bringing the new one on?

As far as I can tell the outgoing screen is copied to a bitmap and then that is used during the transition? I think the copying process takes quite a long time (i.e. it is noticeable) and in come cases (depending on what scaling and anchoring mode you are using) it can cause a judder.

Why can’t the old screen just be left and then purged after the new one is brought on? Maybe in the general case there are memory issues or something but when scenes are lightweight (which the programmer could decide) they would be quite happy just being left there until they are out of view at which time they can then be destroyed.

[import]uid: 102112 topic_id: 17828 reply_id: 88339[/import]

Does storyboard’s memory management take care of nested objects added to the view? [import]uid: 64691 topic_id: 17828 reply_id: 89435[/import]

I found a critical issue of StoryBoard

I tried to create new retina text in scene using StoryBoard

–Work
text1 = display.newRetinaText( “HelloWorld”, 0, 0, native.systemFontBold, 24 )

–Don’t work
text1 = display.newRetinaText( “”, 0, 0, native.systemFontBold, 24 )
text1.text = “HelloWorld”

When display.newText() still works in both cases [import]uid: 128848 topic_id: 17828 reply_id: 90396[/import]

transition fade still is broken, alpha is changed per each object not as a one group

Nobody is using storyboard.gotoScene(“roomName”, “fade”, time) ???

Regards,
Tom [import]uid: 111283 topic_id: 17828 reply_id: 90966[/import]

I was. All of the transitions from scene to scene are broken. [import]uid: 42417 topic_id: 17828 reply_id: 91042[/import]

Hi,
I am having some issues with memeory and storyboard.
Which things do I need to take care of and what does storyboard do for me?
I use a lot of audio. Also I use the removeAll and purgeAll in my scene. I want no cached states.
But the memory usage doesn’t seem to be affected if I use it or not. My memory does not drop back.

I cannot release the display objects myself that will crash the app cause storyboard does that for me.

What can I do to make sure all my variables etc are taken care of?
Are runtime eventlistners the only ones I need to remove myself? I only use eventlisteners that are attached to display objects. Those are removed by Stoyboard as I understand it?
What gets cleared when I use removeAll and PurgeAll?

Thanks. [import]uid: 100901 topic_id: 17828 reply_id: 92400[/import]

storyboard.getScene(“scenename”) returns nil if storyboard.gotoScene(“scenename”) hasn’t been called yet. It would be much better if getScene could create a scene if it didn’t already exist as this would allow me to pass in some data to the scene to set it up correctly the first time. Otherwise, i’m forced to use globals to set up the scene the first time. [import]uid: 122310 topic_id: 17828 reply_id: 93076[/import]

Hi I am really new to Corona and programming so forgive me if I sound silly.

I am trying to handle navigating through different scenes from a navbar always on screen.
I am not using widgets, but simple image buttons.

Because I want the navbar always to stay on top of the scenes I put it in the main.lua,
after invoking the
storyboard.gotoScene( “scene1”, “fade”,3000 )
so that the navbar is not responding to transitions and always stays on top of animated scenes.

This visually works, but when I try to move to a different scene from scene1 using the button in I set up in main.lua I get (many) error messages.

The button code is v. simple like so:

[lua]local function onBtnPress()
storyboard.gotoScene( “scene2”, “fade”,3000 )
end

function myBtn:touch(event)
if(event.phase == “began”) then
print(“this worked”)
onBtnPress()
end

end[/lua]
If I remove the call to the scene2 and I perform some other action such as print, everything works fine. I think I am missing something in the storyboard model?

I find it odd because errors are referring to an OLDSCENE.jpg file which I have not created at all.
These are the errors I get in the terminal:

: CGImageCreate: invalid image size: 0 x 0. : CGContextDrawImage: invalid context 0x0 : CGBitmapContextCreateImage: invalid context 0x0 : CGImageDestinationAddImage image parameter is nil : CGImageDestinationFinalize image destination does not have enough images exit WARNING: Failed to find image(oldscene.jpg) Runtime error ?:0: attempt to index a nil value stack traceback: [C]: ? ?: in function '?' ?: in function 'gotoScene' ....projects/main.lua:95: in function <...projects><br> ?: in function <?:215><br>
Any help appreciated. Thank you Silvia [import]uid: 129146 topic_id: 17828 reply_id: 93077[/import] </…projects>

I’m having a big problem using Storyboard in an actual game context where some display objects need to be created outside of the scene:enterScene function.

I can create objects inside the scene:enterScene function fine and they are removed fine when the scene changes. But for my game, like pretty much all games, I need to create and change display objects outside of the scene:enterScene based on logic that is dependent on specific gameplay events. However, when I try to add new display objects outside of the scene:enterScene function, I am unable to add them to the scene “group” created in scene:enterScene even if I use the group:insert function.

This is basic, fundamental functionality but I can’t find documentation on it anywhere in the Storyboard API or the FAQ or other explanatory posts. I know that Corona staff couldn’t have designed this so that all display objects had to be created inside the scene:enterScene function, right? That seems like it would just be inconsistent with any kind of complex game.

Please help. [import]uid: 76002 topic_id: 17828 reply_id: 93083[/import]

Why don’t you do something like this:

  
function test()  
 local grp = display.newGroup()  
 local txt = display.newText("string", 100,100,native.systemFont,14 )  
 txt:setTextColor(0,0,0)  
 grp:insert(txt)  
 return grp   
end  
  
function scene:createScene( event )  
 local group = self.view  
.....  
grp = test()  
group:insert(grp)  
....  
end  

[import]uid: 10141 topic_id: 17828 reply_id: 93086[/import]

@bdjones

I second having to wrap my storyboard.gotoScene() in a timer.performWithDelay(). Otherwise, I see a snapshot of the scene I’ve just removed during the transition to the next. [import]uid: 73951 topic_id: 17828 reply_id: 93399[/import]

Readdressing the “pop up” question and answer posted way back on page one.

It works great. Once.

For example: press the button which pops up the pop up window and it’s great (other than the fact that all the buttons behind the window are still active…but that’s another issue).

On the pop up window itself, press the button to ‘close’ the window (which simply does a gotoScene(to the previous scene) and that APPEARS to work just fine…as long as you don’t open the same pop up window again in which case the popup window opens on a blank screen (assuming it’s because the previousScene call is now returning nil…for some reason.)

I really like storyboard, but these pop up window issues are going to kill practical usage for me.

Anyone have a good way to create a pop window (more than once)?

Thanks,
Todd [import]uid: 93674 topic_id: 17828 reply_id: 94486[/import]