lua - I can't see any of the buttons, or the background (Corona SDK) -


i'm trying make game android google play store. but, when making main menu ran issue.

before added storyboard , scene functions, worked fine. can't see thing when run it.

also, no errors.

    -- requires      local widget = require "widget"      local storyboard = require ("storyboard")     local scene = storyboard.newscene()      function scene:createscene(event)  screengroup = self.view  -- background local background = display.newimage("images/bg.png") screengroup:insert(background)  -- title local title = display.newimage("images/title.png") title.x = display.contentcenterx title.y = display.contentcentery - 110 screengroup:insert(title)  -- play game local button1 = widget.newbutton {      label = "play game",     font = default,     fontsize = 24,     width = 200,     height = 50  } button1.x = display.contentcenterx button1.y = display.contentcentery - 47 screengroup:insert(button1)  -- how play local button2 = widget.newbutton {      label = "how play",     font = default,     fontsize = 24,     width = 200,     height = 50  } button2.x = display.contentcenterx button2.y = display.contentcentery + 13 screengroup:insert(button2)  -- level select local button3 = widget.newbutton {      label = "level select",     font = default,     fontsize = 24,     width = 200,     height = 50  } button3.x = display.contentcenterx button3.y = display.contentcentery + 73 screengroup:insert(button3)  -- local button4 = widget.newbutton {      label = "about us",     font = default,     fontsize = 24,     width = 200,     height = 50  } button4.x = display.contentcenterx button4.y = display.contentcentery + 133 screengroup:insert(button4)      end      function start(event) if event.phase == "began"     storyboard.gotoscene("level1", "fade", 400) end     end      function scene:enterscene(event) button1:addeventlistener("touch", start)     end      return scene 

try this:

main.lua

local storyboard = require "storyboard" storyboard.gotoscene( "scene1") 

scene1.lua

local storyboard = require( "storyboard" ) local scene = storyboard.newscene()  function scene:createscene( event )     local screengroup = self.view      -- background     local background = display.newimage("images/bg.png")     screengroup:insert(background)      -- title     local title = display.newimage("images/title.png")     title.x = display.contentcenterx     title.y = display.contentcentery - 110     screengroup:insert(title)      -- play game     local button1 = widget.newbutton {          label = "play game",         font = default,         fontsize = 24,         width = 200,         height = 50      }     button1.x = display.contentcenterx     button1.y = display.contentcentery - 47     screengroup:insert(button1)      -- how play     local button2 = widget.newbutton {          label = "how play",         font = default,         fontsize = 24,         width = 200,         height = 50      }     button2.x = display.contentcenterx     button2.y = display.contentcentery + 13     screengroup:insert(button2)      -- level select     local button3 = widget.newbutton {          label = "level select",         font = default,         fontsize = 24,         width = 200,         height = 50      }     button3.x = display.contentcenterx     button3.y = display.contentcentery + 73     screengroup:insert(button3)      --     local button4 = widget.newbutton {          label = "about us",         font = default,         fontsize = 24,         width = 200,         height = 50      }     button4.x = display.contentcenterx     button4.y = display.contentcentery + 133     screengroup:insert(button4)  end  function start(event)     if event.phase == "began"         storyboard.gotoscene("level1", "fade", 400)     end end  function scene:enterscene(event)     button1:addeventlistener("touch", start) end  scene:addeventlistener( "createscene", scene ) scene:addeventlistener( "enterscene", scene )  return scene 

Comments