Storyboard throws a bounch of errors....

Ok, I just completed my storyboard yesterday, and it seems straight forward, but I ran into problems when I added a feature to my levelselect page.

This is my code that adds several of images on the screen with small locks.

for i = 1, 10, 1 do  
 level[i] = display.newGroup()  
  
 level[i]:insert(display.newImage( "level.png" ))  
  
 local imgLock = display.newImage( "level\_lock.png" )  
 level[i]:insert(imgLock)  
 imgLock.x = 40  
 imgLock.y = 36  
  
 if(i\<6) then  
 level[i].y = screenH / 2.7  
 level[i].x = (i\*70) + 30  
 else  
 level[i].y = screenH / 1.7  
 level[i].x = ((i-5)\*70) + 30  
 end  
 level[i].tag = "level1\_" .. i  
 level[i]:addEventListener("touch", StartLevel)  
 level[i].alpha = 0  
  
 transition.to(level[i],{alpha=1,time=500})  
 group:insert(level[i])  
 end  

And as soon as I switch scene the terminal gives me the following errors. I am 100% sure that it has to do with the code above.

Jan 10 19:14:35 Macintosh.local Corona Simulator[12859] <error>: CGImageCreate: invalid image width.<br>Jan 10 19:14:35 Macintosh.local Corona Simulator[12859] <error>: CGBitmapContextCreate: unsupported parameter combination: 8 integer bits/component; 8 bits/pixel; 0-component color space; kCGImageAlphaNoneSkipFirst; 4294967136 bytes/row.<br>Jan 10 19:14:35 Macintosh.local Corona Simulator[12859] <error>: CGContextDrawImage: invalid context 0x0<br>Jan 10 19:14:35 Macintosh.local Corona Simulator[12859] <error>: CGBitmapContextCreateImage: invalid context 0x0<br>ImageIO: <error> CGImageDestinationAddImage image parameter is nil<br>ImageIO: <error> CGImageDestinationFinalize image destination does not have enough images<br>Jan 10 19:14:35 Macintosh.local Corona Simulator[12859] <error>: CGImageCreate: invalid image width.<br>Jan 10 19:14:35 Macintosh.local Corona Simulator[12859] <error>: CGBitmapContextCreate: unsupported parameter combination: 8 integer bits/component; 8 bits/pixel; 0-component color space; kCGImageAlphaNoneSkipFirst; 4294967136 bytes/row.<br>Jan 10 19:14:35 Macintosh.local Corona Simulator[12859] <error>: CGContextDrawImage: invalid context 0x0<br>Jan 10 19:14:35 Macintosh.local Corona Simulator[12859] <error>: CGBitmapContextCreateImage: invalid context 0x0<br>ImageIO: <error> CGImageDestinationAddImage image parameter is nil<br>ImageIO: <error> CGImageDestinationFinalize image destination does not have enough images<br>2012-01-10 19:14:35.775 Corona Simulator[12859:2403] glError at end unbindRenderFBO<br><br>

Help, I am knee-deep into trouble here!

Regards, Joakim
[import]uid: 81188 topic_id: 20221 reply_id: 320221[/import]

is that code in the createScene event handler or the enterScene event handler?

createScene must put at least one display object into group to avoid that error.

any scene file going to or coming from has to have something in group.
[import]uid: 19626 topic_id: 20221 reply_id: 78954[/import]

Hi again,

I am doing this in the enterScene handler. And I am putting the new group into the following group:

local group = self.view



group:insert(level[i])
as you can see in my previous post. Could there be something wrong when i am adding a new group to the group that takes care of everything?

Joakim [import]uid: 81188 topic_id: 20221 reply_id: 78962[/import]

do something like this in createScene:

local bg = display.newRect(0,0,display.contentWidth, display.contentHeight)
bg:isVisible = false
group:insert(bg)

and see if that fixes your problem.
[import]uid: 19626 topic_id: 20221 reply_id: 78968[/import]

Arghhh, stupid me - i had a loop outside my inner loop so that was not so smart :smiley:

Thanks, but your solution got me on track :wink:

Joakim
[import]uid: 81188 topic_id: 20221 reply_id: 78972[/import]