I’m a bit confused about how Corona handles coordinates across different devices with differing screen resolutions. For example, if I’m displaying something on Retina that is outside the screen coordinates of a 3G phone, how am I supposed to convert the coordinates for the 3G phone.
e.g.
-- Assume this is for a Retina display
local myObject = display.newImageRect("image.png", 50, 50)
myObject.x = 600
myObject.y = 700
How should I write the code so that it will display correctly on a 3G device?
Like this?
local deviceModifier = 0
-- Assume this is for a Retina or 3G display only
if (ThisDeviceIsRetina) then -- ThisDeviceIsRetina is made-up code, just assume it returns True if the Device is Retina
deviceModifier = 0
else
deviceModifier = 0.5
end
local myObject = display.newImageRect("image.png", 50, 50)
myObject.x = 600 \* deviceModifier
myObject.y = 700 \* deviceModifier
Is that the sort of approach to take or am I missing a feature of Corona that does this automagically? [import]uid: 26769 topic_id: 13166 reply_id: 313166[/import]
[import]uid: 26769 topic_id: 13166 reply_id: 48322[/import]