Corona Storyboard API and Scenes

can someone please explain to me how 

function scene:createScene( event )

    local group = self.view

this code works??? 

correct me if i am wrong:

a local variable named group is created…

but i don’t understand what self.view does/means???

i need help understanding the code of scenes

im looking at a sample code and from it and i need some clarification on how scenes work

Thanks!

The crucial part is in the declaration of scene:

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

scene:createScene(event) is the same as

scene.createScene(scene, event)

The variable ‘self’ refers to the ‘scene’ object that is passed in automatically when using the colon operator (check out PiL for more information).

The ‘view’ property of ‘self’ is a display group created on the scene object.

can you explain it again??? i’m not understanding?

what is scene.createScene(scene,event) ?? what’s happening- what’s being passed in etc.

@Sega

For your own benefit I suggest reading more about lua. If you knew the language you would understand what I posted - that’s not a knock but some advice as you will get frustrated with Corona if you don’t understand the basics of the language you’re using. To start I recommend reading Programming in Lua Lua Users

Yes, and PIL (Programming In Lua) the last NO.3 that was released this year The frustrating part of Storyboard is all explained several places in this forum

When you call storyboard.gotoScene(“somescene”), it loads in “somescene.lua” and at the top of that scene is the call:

local scene = storyboard.newScene()

This function creates a table/object called scene and one of it’s menbers is named .view.  That scene.view is a display.newGroup() that is used to hold all of the images and objects that make up the scene.

When scene:createScene and the other functions are called, because we use the “:” operator, the parameter “self” is automatically passed in so the function knows about it.  So self = scene and self.view is the scene’s group. 

At least that’s how we get there.

The crucial part is in the declaration of scene:

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

scene:createScene(event) is the same as

scene.createScene(scene, event)

The variable ‘self’ refers to the ‘scene’ object that is passed in automatically when using the colon operator (check out PiL for more information).

The ‘view’ property of ‘self’ is a display group created on the scene object.

can you explain it again??? i’m not understanding?

what is scene.createScene(scene,event) ?? what’s happening- what’s being passed in etc.

@Sega

For your own benefit I suggest reading more about lua. If you knew the language you would understand what I posted - that’s not a knock but some advice as you will get frustrated with Corona if you don’t understand the basics of the language you’re using. To start I recommend reading Programming in Lua Lua Users

@Rob thank you!! This should be explained in the page for storyboard on here, that really helps my understanding! Thanks a lot once again! Nice detail on syntax, that’s what i wanted! 

Yes, and PIL (Programming In Lua) the last NO.3 that was released this year The frustrating part of Storyboard is all explained several places in this forum

When you call storyboard.gotoScene(“somescene”), it loads in “somescene.lua” and at the top of that scene is the call:

local scene = storyboard.newScene()

This function creates a table/object called scene and one of it’s menbers is named .view.  That scene.view is a display.newGroup() that is used to hold all of the images and objects that make up the scene.

When scene:createScene and the other functions are called, because we use the “:” operator, the parameter “self” is automatically passed in so the function knows about it.  So self = scene and self.view is the scene’s group. 

At least that’s how we get there.

@Rob thank you!! This should be explained in the page for storyboard on here, that really helps my understanding! Thanks a lot once again! Nice detail on syntax, that’s what i wanted! 

@Rob, yes thank you that is the explanation that should be in the Corona documentation.

now, in a scene (level) I would like to have different view groups e.g. all the figurines of the level would be in the scene group

but if the level fails i’ve got some animation and things that I want to remove after the user clicks the <try again > button.

So, do I inserts these objects into TWO view groups or can I insert one view group into the one for the scene ?

again… you´re the man Rob (think you wore a teacher in former life :wink:

@Rob, yes thank you that is the explanation that should be in the Corona documentation.

now, in a scene (level) I would like to have different view groups e.g. all the figurines of the level would be in the scene group

but if the level fails i’ve got some animation and things that I want to remove after the user clicks the <try again > button.

So, do I inserts these objects into TWO view groups or can I insert one view group into the one for the scene ?

again… you´re the man Rob (think you wore a teacher in former life :wink: