going to another scene

so, I made a scene and used gotoScene

my problem is in scene:create when I inserted a tableView and an image into the scene group they aren’t showing up, When I just don’t insert them they show up…

While when I insert a text to the scene group it shows and the tableView and image doesn’t

any idea why this happens ?

Hi @andrew_wahid,

You will need to post some code to get help on this. The staff/community cannot know what you’ve programmed and why this is happening unless they see the code.

As always, remember to surround your code with “lua” tags for clarity:

[lua] --code [/lua]

Thanks,

Brent

Well, okay…

Also I just discovered that the text was the only thing that shows because it was the last thing that I insert into the scene group… When I tried to insert the tableView the last thing it appeared and the text didn’t

[lua]

function scene:create( event )

    local sceneGroup = self.view

local ox, oy = math.abs(display.screenOriginX), math.abs(display.screenOriginY)

    local sceneBackground = display.newImageRect( “background.png”, 850, 1250 )

    local chooseText = display.newText(sceneInformation.sceneTitle, 150, 50, native.systemFontBold, 20, “center” )

local tableViewColors = {

rowColor = { default = { 1 }, over = { 30/255, 144/255, 1 } },

lineColor = { 220/255 },

catColor = { default = { 150/255, 160/255, 180/255, 200/255 }, over = { 150/255, 160/255, 180/255, 200/255 } },

defaultLabelColor = { 0, 0, 0, 0.6 },

catLabelColor = { 0 }

}

tableViewColors.rowColor.default = { 48/255 }

tableViewColors.rowColor.over = { 72/255 }

tableViewColors.lineColor = { 36/255 }

tableViewColors.catColor.default = { 80/255, 80/255, 80/255, 0.9 }

tableViewColors.catColor.over = { 80/255, 80/255, 80/255, 0.9 }

tableViewColors.defaultLabelColor = { 1, 1, 1, 0.6 }

tableViewColors.catLabelColor = { 1 }

    local tableView = widget.newTableView

    {

    left = 10,

    top = 100,

    height = 400,

    width = 300,

    onRowRender = onRowRender,

    onRowTouch = onRowTouch,

    --listener = scrollListener

    }

for i=0, #sceneInformation[tableViewLoop] do

   if i == 0 then

   text = sceneInformation[tableViewLoop].category_1

   isCategory = true

rowHeight = 40

            rowColor = {

default = tableViewColors.catColor.default,

over = tableViewColors.catColor.over

}

elseif i == 47 then

   text = sceneInformation[tableViewLoop].category_2

   isCategory = true

rowHeight = 40

rowColor = {

default = tableViewColors.catColor.default,

over = tableViewColors.catColor.over

}

else

   text = sceneInformation[documentNames][i][1]

isCategory = false

   rowHeight = 36

            rowColor = { 

default = tableViewColors.rowColor.default,

over = tableViewColors.rowColor.over,

}

end

tableView:insertRow(

        {

            isCategory = isCategory,

            rowHeight = rowHeight,

            rowColor = rowColor,

            lineColor = tableViewColors.lineColor,

params = {rowText=text},

        }

    )

end

sceneGroup:insert( chooseText )

sceneGroup:insert( sceneBackground )

sceneGroup:insert( tableView )

end

[/lua]

Hi @andrew_wahid,

Can you post a screenshot? Is the tableView laying over (in front of) the text and hiding it?

Brent

Just discovered something,

If I used a transition effect such as fade in gotoScene in main.lua

Everything they are visible and faded in once the transition ends the last thing inserted is the visible one and the others dissapear…

And forgot to say that the display objects in main.lua doesn’t dissapear

Anyway, here’s the screenshot

The 3 test icons (corona icons) and the background are from main.lua

http://i.imgur.com/W2YKLsr.png

Also found out something else when I change the order of inserting

1-inserting background

2-Text

3-TableView

The text and the tableView appears but the background doesn’t…

Hi @andrew_wahid,

What is the “background”? The blue region?

Also, you shouldn’t use main.lua as a place to create objects in scenes. When using Composer, it’s best to simply use main.lua for non-Composer aspects, and then guide the user to the initial scene from the proper place within main.lua.

One potential exception would be if you want to create UI/image objects that will always overlay every Composer scene, like some kind of menu bar or “HUD” (heads-up display) that will never be transitioned or affected by changing Composer scenes.

Brent

Yes, it is.

And that’s what I did right after posting my last reply…

I would love to do that just if I know how… :smiley:

The problem still exists I am just curiosed about a thing, what would happen if I didn’t insert them in the scene group ?

I tried not inserting them and they work good. But I don’t know if I want to hide the scene are they going to be hidden with it or not…

Hi @andrew_wahid,

Objects that aren’t inserted into a scene will never be “managed” by the scene, by strict rule… Composer only deals with what you give it.

In your screenshot, I see the blue background, so I don’t know what you mean by “it’s not appearing”.  :huh:

Brent

Lol, I was using the same background in main.lua so when I go to another scene the main.lua 's background doesn’t dissapear and the one in the scene doesn’t appear…

Anyway , I somehow fixed my problem… I am not sure how I did that, But I just re-wrote my code with a better format…

Hi @andrew_wahid,

You will need to post some code to get help on this. The staff/community cannot know what you’ve programmed and why this is happening unless they see the code.

As always, remember to surround your code with “lua” tags for clarity:

[lua] --code [/lua]

Thanks,

Brent

Well, okay…

Also I just discovered that the text was the only thing that shows because it was the last thing that I insert into the scene group… When I tried to insert the tableView the last thing it appeared and the text didn’t

[lua]

function scene:create( event )

    local sceneGroup = self.view

local ox, oy = math.abs(display.screenOriginX), math.abs(display.screenOriginY)

    local sceneBackground = display.newImageRect( “background.png”, 850, 1250 )

    local chooseText = display.newText(sceneInformation.sceneTitle, 150, 50, native.systemFontBold, 20, “center” )

local tableViewColors = {

rowColor = { default = { 1 }, over = { 30/255, 144/255, 1 } },

lineColor = { 220/255 },

catColor = { default = { 150/255, 160/255, 180/255, 200/255 }, over = { 150/255, 160/255, 180/255, 200/255 } },

defaultLabelColor = { 0, 0, 0, 0.6 },

catLabelColor = { 0 }

}

tableViewColors.rowColor.default = { 48/255 }

tableViewColors.rowColor.over = { 72/255 }

tableViewColors.lineColor = { 36/255 }

tableViewColors.catColor.default = { 80/255, 80/255, 80/255, 0.9 }

tableViewColors.catColor.over = { 80/255, 80/255, 80/255, 0.9 }

tableViewColors.defaultLabelColor = { 1, 1, 1, 0.6 }

tableViewColors.catLabelColor = { 1 }

    local tableView = widget.newTableView

    {

    left = 10,

    top = 100,

    height = 400,

    width = 300,

    onRowRender = onRowRender,

    onRowTouch = onRowTouch,

    --listener = scrollListener

    }

for i=0, #sceneInformation[tableViewLoop] do

   if i == 0 then

   text = sceneInformation[tableViewLoop].category_1

   isCategory = true

rowHeight = 40

            rowColor = {

default = tableViewColors.catColor.default,

over = tableViewColors.catColor.over

}

elseif i == 47 then

   text = sceneInformation[tableViewLoop].category_2

   isCategory = true

rowHeight = 40

rowColor = {

default = tableViewColors.catColor.default,

over = tableViewColors.catColor.over

}

else

   text = sceneInformation[documentNames][i][1]

isCategory = false

   rowHeight = 36

            rowColor = { 

default = tableViewColors.rowColor.default,

over = tableViewColors.rowColor.over,

}

end

tableView:insertRow(

        {

            isCategory = isCategory,

            rowHeight = rowHeight,

            rowColor = rowColor,

            lineColor = tableViewColors.lineColor,

params = {rowText=text},

        }

    )

end

sceneGroup:insert( chooseText )

sceneGroup:insert( sceneBackground )

sceneGroup:insert( tableView )

end

[/lua]

Hi @andrew_wahid,

Can you post a screenshot? Is the tableView laying over (in front of) the text and hiding it?

Brent

Just discovered something,

If I used a transition effect such as fade in gotoScene in main.lua

Everything they are visible and faded in once the transition ends the last thing inserted is the visible one and the others dissapear…

And forgot to say that the display objects in main.lua doesn’t dissapear

Anyway, here’s the screenshot

The 3 test icons (corona icons) and the background are from main.lua

http://i.imgur.com/W2YKLsr.png

Also found out something else when I change the order of inserting

1-inserting background

2-Text

3-TableView

The text and the tableView appears but the background doesn’t…

Hi @andrew_wahid,

What is the “background”? The blue region?

Also, you shouldn’t use main.lua as a place to create objects in scenes. When using Composer, it’s best to simply use main.lua for non-Composer aspects, and then guide the user to the initial scene from the proper place within main.lua.

One potential exception would be if you want to create UI/image objects that will always overlay every Composer scene, like some kind of menu bar or “HUD” (heads-up display) that will never be transitioned or affected by changing Composer scenes.

Brent

Yes, it is.

And that’s what I did right after posting my last reply…

I would love to do that just if I know how… :smiley:

The problem still exists I am just curiosed about a thing, what would happen if I didn’t insert them in the scene group ?

I tried not inserting them and they work good. But I don’t know if I want to hide the scene are they going to be hidden with it or not…

Hi @andrew_wahid,

Objects that aren’t inserted into a scene will never be “managed” by the scene, by strict rule… Composer only deals with what you give it.

In your screenshot, I see the blue background, so I don’t know what you mean by “it’s not appearing”.  :huh:

Brent

Lol, I was using the same background in main.lua so when I go to another scene the main.lua 's background doesn’t dissapear and the one in the scene doesn’t appear…

Anyway , I somehow fixed my problem… I am not sure how I did that, But I just re-wrote my code with a better format…