Author Topic: Composer not working as expected  (Read 1405 times)

2016-01-15, 08:31:24

jh8080

  • Users
  • *
  • Posts: 1
    • View Profile
I am trying out composer with the following code:

Code: [Select]
--main.lua
local composer = require( "composer" )
local scene = composer.newScene()

function scene:create( event )
    local sceneGroup = self.view

    local background = display.newRect( display.contentCenterX, display.contentCenterY, display.contentWidth, display.contentHeight )
    background:setFillColor( 1, 1, 1 )

    sceneGroup:insert( background )
end

scene:addEventListener( "create", scene )

return scene
However, it gives me a black screen in the simulator, which the background didn't appear. Am I missing something?
« Last Edit: 2016-01-15, 09:25:57 by heaven9959 »

2016-01-15, 09:14:10
Reply #1

johan belmans

  • Primary Certified Instructor
  • Active Users
  • ***
  • Posts: 768
    • View Profile
    • blacksquid
I guess you are on the wrong forum. This is not Corona labs.

cheers