anchor point

hii,

i have some problem with anchor point. i thought   

objectName.anchorX=0

and objectName.anchorY=0

will move the origin to the upper left corner of the image i still got my image away from the origin .

here is my code

local physics=require("physics") physics.start(); local bg=display.newImageRect("b1.png",1500,700); bg.anchorX=0 bg.anchorY=0 bg.x=0 bg.y=0

and my result:

anyone has suggestion?

Position of (0, 0) on the screen depends of your settings in config.lua. You can read more about it in Project Configuration in section Content Scaling.

application = { content = { width = 1024, height = 768, scale = “letterBox”, fps = 30, --[[imageSuffix = { ["@2x"] = 2, ["@4x"] = 4, }, --]] }, }

now i dont know whats the matter with my origin ,i used landscape mode and simply i dont know whats wrong with my config.lua file

@idurniat

thanks.i think i have got solution which is my scaling method.when i tried "zoomEven "it works perfectly…thanks

Ideally you don’t want to be using zoomEven - on different devices a circle shape would appear as an oval.

When using letterBox, which is the recommended mode, the top left of the screen is not always 0, 0 depending on the device.

To get these values, use display.screenOriginX and display.screenOriginY. 

@ nick sherman

thanks a lot

anyone has suggestion?

Position of (0, 0) on the screen depends of your settings in config.lua. You can read more about it in Project Configuration in section Content Scaling.

application = { content = { width = 1024, height = 768, scale = “letterBox”, fps = 30, --[[imageSuffix = { ["@2x"] = 2, ["@4x"] = 4, }, --]] }, }

now i dont know whats the matter with my origin ,i used landscape mode and simply i dont know whats wrong with my config.lua file

@idurniat

thanks.i think i have got solution which is my scaling method.when i tried "zoomEven "it works perfectly…thanks

Ideally you don’t want to be using zoomEven - on different devices a circle shape would appear as an oval.

When using letterBox, which is the recommended mode, the top left of the screen is not always 0, 0 depending on the device.

To get these values, use display.screenOriginX and display.screenOriginY. 

@ nick sherman

thanks a lot