Hello, in my project I'm using Letterbox and relative positioning of objects in my scene and it works fine with different resolutions. For that I use the examples in the App Coding Easy blog.
But for a future app feature I would like to get a value, say, a 1000th of the current device screen width & height to position objects. But I don't seem to work it out.
A question related to this is the getDeviceWidth() function. It returns the correct values in output but it places the object roughly only two thirds of the expected position. What am I missing?
devicewidth = application:getDeviceHeight()
deviceheight = application:getDeviceWidth()
dx = application:getLogicalTranslateX() / application:getLogicalScaleX()
dy = application:getLogicalTranslateY() / application:getLogicalScaleY()
local blacksquare = Bitmap.new(Texture.new("images/blacksquare.png", true))
blacksquare:setPosition(-dx + devicewidth, -dy + deviceheight)
Example: for a iPhone 5 retina 1136x640 resolution (landscape), the object ends up at ca 758x427.
Thanks in advance