My app is squashed in the top left corner of the simulator

This app shows 4 numbers, and the user can increase or decrease them by tapping + or - buttons.

I actually wrote this code in a blank Corona file and it worked fine - all the buttons/numbers positioned where I want them. When I copied the code into my composer project, the entire screen is squashed in the top left corner of the simulator. Can anyone identify why? I feel like its something to do with composer…

Screen cap of simulator: http://imgur.com/DqIVJs0

local composer = require( "composer" ) local scene = composer.newScene() local widget = require("widget") -- ----------------------------------------------------------------------------------------------------------------- -- All code outside of the listener functions will only be executed ONCE unless "composer.removeScene()" is called. -- ----------------------------------------------------------------------------------------------------------------- -- local forward references should go here -- ------------------------------------------------------------------------------- -- "scene:create()" function scene:create( event ) local sceneGroup = self.view -- Initialize the scene here. -- Example: add display objects to "sceneGroup", add touch listeners, etc. local width = display.actualContentWidth local height = display.actualContentHeight local background = display.newRect(sceneGroup, 0, 0, width, height) background.x = width \* 0.5 background.y = height \* 0.5 end -- "scene:show()" function scene:show( event ) local sceneGroup = self.view local phase = event.phase if ( phase == "will" ) then -- Called when the scene is still off screen (but is about to come on screen). elseif ( phase == "did" ) then ---- PLAYER ONE local number1 = 20 local playerOneScore = display.newText(sceneGroup, number1, 60, 90, "SIMPLE LIFE", 100) playerOneScore:setTextColor(0, 0, 0) --- PLAYER ONE FUNCTIONS local function p1plussed(event) if( event.phase == "ended") then number1 = number1 + 1 playerOneScore:removeSelf() playerOneScore = display.newText(sceneGroup, number1, 60, 90, "SIMPLE LIFE", 100) playerOneScore:setTextColor(0, 0, 0) end end local p1plus\_btn = widget.newButton { defaultFile ="plus.png", onEvent= p1plussed } p1plus\_btn.x = 265 p1plus\_btn.y = 90 sceneGroup:insert(p1plus\_btn) local function p1minused(event) if( event.phase == "ended") then number1 = number1 - 1 playerOneScore:removeSelf() playerOneScore = display.newText(sceneGroup, number1, 60, 90, "SIMPLE LIFE", 100) playerOneScore:setTextColor(0, 0, 0) end end local p1minus\_btn = widget.newButton { defaultFile ="minus.png", onEvent= p1minused } p1minus\_btn.x = 155 p1minus\_btn.y = 90 sceneGroup:insert(p1minus\_btn) ---- PLAYER Two local number2 = 20 local playerTwoScore = display.newText(sceneGroup, number2, 60, 220, "SIMPLE LIFE", 100) playerTwoScore:setTextColor(0, 0, 0) sceneGroup:insert(playerTwoScore) --- PLAYER Two FUNCTIONS local function p2plussed(event) if( event.phase == "ended") then number2 = number2 + 1 playerTwoScore:removeSelf() playerTwoScore = display.newText(sceneGroup, number2, 60, 220, "SIMPLE LIFE", 100) playerTwoScore:setTextColor(0, 0, 0) end end local p2plus\_btn = widget.newButton { defaultFile ="plus.png", onEvent= p2plussed } p2plus\_btn.x = 265 p2plus\_btn.y = 220 sceneGroup:insert(p2plus\_btn) local function p2minused(event) if( event.phase == "ended") then number2 = number2 - 1 playerTwoScore:removeSelf() playerTwoScore = display.newText(sceneGroup, number2, 60, 220, "SIMPLE LIFE", 100) playerTwoScore:setTextColor(0, 0, 0) end end local p2minus\_btn = widget.newButton { defaultFile ="minus.png", onEvent= p2minused } p2minus\_btn.x = 155 p2minus\_btn.y = 220 sceneGroup:insert(p2minus\_btn) ---- PLAYER Three local number3 = 20 local playerThreeScore = display.newText(sceneGroup, number3, 60, 355, "SIMPLE LIFE", 100) playerThreeScore:setTextColor(0, 0, 0) sceneGroup:insert(playerThreeScore) --- PLAYER Three FUNCTIONS local function p3plussed(event) if( event.phase == "ended") then number3 = number3 + 1 playerThreeScore:removeSelf() playerThreeScore = display.newText(sceneGroup, number3, 60, 355, "SIMPLE LIFE", 100) playerThreeScore:setTextColor(0, 0, 0) end end local p3plus\_btn = widget.newButton { defaultFile ="plus.png", onEvent= p3plussed } p3plus\_btn.x = 265 p3plus\_btn.y = 355 sceneGroup:insert(p3plus\_btn) local function p3minused(event) if( event.phase == "ended") then number3 = number3 - 1 playerThreeScore:removeSelf() playerThreeScore = display.newText(sceneGroup, number3, 60, 355, "SIMPLE LIFE", 100) playerThreeScore:setTextColor(0, 0, 0) end end local p3minus\_btn = widget.newButton { defaultFile ="minus.png", onEvent= p3minused } p3minus\_btn.x = 155 p3minus\_btn.y = 355 sceneGroup:insert(p3minus\_btn) ---- PLAYER Four local number4 = 20 local playerFourScore = display.newText(sceneGroup, number4, 60, 480, "SIMPLE LIFE", 100) playerFourScore:setTextColor(0, 0, 0) sceneGroup:insert(playerFourScore) --- PLAYER Four FUNCTIONS local function p4plussed(event) if( event.phase == "ended") then number4 = number4 + 1 playerFourScore:removeSelf() playerFourScore = display.newText(sceneGroup, number4, 60, 480, "SIMPLE LIFE", 100) playerFourScore:setTextColor(0, 0, 0) end end local p4plus\_btn = widget.newButton { defaultFile ="plus.png", onEvent= p4plussed } p4plus\_btn.x = 265 p4plus\_btn.y = 480 sceneGroup:insert(p4plus\_btn) local function p4minused(event) if( event.phase == "ended") then number4 = number4 - 1 playerFourScore:removeSelf() playerFourScore = display.newText(sceneGroup, number4, 60, 480, "SIMPLE LIFE", 100) playerFourScore:setTextColor(0, 0, 0) end end local p4minus\_btn = widget.newButton { defaultFile ="minus.png", onEvent= p4minused } p4minus\_btn.x = 155 p4minus\_btn.y = 480 sceneGroup:insert(p4minus\_btn) end end -- "scene:hide()" function scene:hide( event ) local sceneGroup = self.view local phase = event.phase if ( phase == "will" ) then -- Called when the scene is on screen (but is about to go off screen). -- Insert code here to "pause" the scene. -- Example: stop timers, stop animation, stop audio, etc. elseif ( phase == "did" ) then -- Called immediately after scene goes off screen. end end -- "scene:destroy()" function scene:destroy( event ) local sceneGroup = self.view -- Called prior to the removal of scene's view ("sceneGroup"). -- Insert code here to clean up the scene. -- Example: remove display objects, save state, etc. end -- ------------------------------------------------------------------------------- -- Listener setup scene:addEventListener( "create", scene ) scene:addEventListener( "show", scene ) scene:addEventListener( "hide", scene ) scene:addEventListener( "destroy", scene ) -- ------------------------------------------------------------------------------- return scene

Hello. Posting that much code and not formatted properly probably wont get you help for a long time. When posting code press the “<>” button and put your code in there.

But on a quick note – Did you put everything into sceneGroup? 

Dont put all your code into the create scene. All code goes into show scene “did” phase except for the images that you wont be touching (background) and stuff like that.

–SonicX278

Apologies - this is my first post. I have edited the formatting of the code above.

I have moved my code into the the “did” phase of show scene, but it has not fixed my problem: http://imgur.com/DqIVJs0

Is there any additional information I can provide to make diagnosing this problem easier? 

Hello. Posting that much code and not formatted properly probably wont get you help for a long time. When posting code press the “<>” button and put your code in there.

But on a quick note – Did you put everything into sceneGroup? 

Dont put all your code into the create scene. All code goes into show scene “did” phase except for the images that you wont be touching (background) and stuff like that.

–SonicX278

Apologies - this is my first post. I have edited the formatting of the code above.

I have moved my code into the the “did” phase of show scene, but it has not fixed my problem: http://imgur.com/DqIVJs0

Is there any additional information I can provide to make diagnosing this problem easier?