(0.0) coordinates display images off screen

I’m just starting with corona, checking the docs.

I use

local myImage = display.newImage( "image.png", 0, 0)

to position my image on the top left corner. But its mostly out of the borders (on the simulator)

other than that, I’m using the standard (basic) conf.lua and there’s nothing else on my main.lua file

Corona’s default way of positioning things is to center the object on the X, Y coordinates you specified.  That code will center the image at 0, 0.

You have two options:

  1. Position the center where you want it.

    local myImage = display.newImage( “image.png”, display.contentCenterX, display.contentCenterY)

  2. Tell Corona to use the Top Left corner of the object as its X, Y

    local myImage = display.newImage( “image.png”, 0, 0) myImage.anchorX = 0  – default is 0.5, the center myImage.anchorY = 0  – default is 0.5, the center

Rob

Corona’s default way of positioning things is to center the object on the X, Y coordinates you specified.  That code will center the image at 0, 0.

You have two options:

  1. Position the center where you want it.

    local myImage = display.newImage( “image.png”, display.contentCenterX, display.contentCenterY)

  2. Tell Corona to use the Top Left corner of the object as its X, Y

    local myImage = display.newImage( “image.png”, 0, 0) myImage.anchorX = 0  – default is 0.5, the center myImage.anchorY = 0  – default is 0.5, the center

Rob