I’m trying to center an image, but this won’t work, any idea why? I can’t see the image at all on the screen
local helicopter = display.newImageRect(“Helicopters/Default.png”,dY*0.075,dY*0.075)
helicopter.x = dX/2
helicopter.y = dY/2
I’m trying to center an image, but this won’t work, any idea why? I can’t see the image at all on the screen
local helicopter = display.newImageRect(“Helicopters/Default.png”,dY*0.075,dY*0.075)
helicopter.x = dX/2
helicopter.y = dY/2
It depends entirely on what you have dX and dY set to.
Try this:
local dX, dY = display.contentWidth, display.contentHeight
Try
helicopter.x = display.contentCenterX helicopter.y = display.contentCenterY
Good Luck!
It depends entirely on what you have dX and dY set to.
Try this:
local dX, dY = display.contentWidth, display.contentHeight
Try
helicopter.x = display.contentCenterX helicopter.y = display.contentCenterY
Good Luck!