I am trying to put in text for my app ut i am getting this error .
[C]: in function ‘newText’
C:\Users\brandon\Documents\Corona Projects\zombie survival\game.lua:25:
in function <C:\Users\brandon\Documents\Corona Projects\zombie survival\game.lua
:13>
function scene:createScene(event) ads.hide() local screenGroup = self.view local background = display.newImageRect("images.png",display.contentWidth,display.contentHeight) background.x = display.contentCenterX background.y = display.contentCenterY screenGroup:insert(background) round = 1 roundTxt = display.newText( "Round: "..round, centerX, centerY, native.systemFontBold, 40 ) minigun = display.newImage("minigun2.png") minigun.x = 50 minigun.y = 300 screenGroup:insert(minigun) zombie = display.newImage("images3.png") zombie.x = 410 zombie.y = 200 screenGroup:insert(zombie) end
JonPM
2
try:
roundTxt = display.newText( "Round: "…tostring(round), centerX, centerY, native.systemFontBold, 40 )
Still getting the same error .
I tried this in a sample project and it works like its supposed to.
centerX = display.contentCenterX centerY = display.contentCenterY round = 1 roundTxt = display.newText( "Round: "..round, centerX, centerY, native.systemFontBold, 40 )
Do you have the centerX and centerY variables?
–SonicX278
JonPM
7
try:
roundTxt = display.newText( "Round: "…tostring(round), centerX, centerY, native.systemFontBold, 40 )
Still getting the same error .
I tried this in a sample project and it works like its supposed to.
centerX = display.contentCenterX centerY = display.contentCenterY round = 1 roundTxt = display.newText( "Round: "..round, centerX, centerY, native.systemFontBold, 40 )
Do you have the centerX and centerY variables?
–SonicX278