hey david,
do you want the app to be able to rotate at all?
if not just go to your build.settings and get rid of of portrait in your supported table
[lua]
orientation =
{
default = “landscape”,
supported = { “landscape”, }
},
[/lua]
further read:
http://docs.coronalabs.com/guide/distribution/buildSettings/index.html
if you want your app to be viewable in landscape and portrait, simply add something like this:
[lua]
local function onOrientationChange( event )
local direction = event.type
if (direction == “landscapeLeft” or direction == “landscapeRight”) then
--move your objects to the positions they suppose to have on landscape
else
--move your objects to the positions they suppose to have on portrait
end
end
Runtime:addEventListener( “orientation”, onOrientationChange )
[/lua]
further read: http://www.coronalabs.com/blog/2011/01/28/use-dynamic-layouts-in-universal-builds-with-corona-sdk/ (at the bottom)
Or in your case, this should already be enough to do the trick:
[lua]
local function onOrientationChange( event )
image.x = display.contentWidth - image.width
end
Runtime:addEventListener( “orientation”, onOrientationChange )
[/lua]
for your understanding of the issue:
your objects are all having fixed non-dynamic coordinates. even when you have the feeling they do have dynamic coordinates because you placed them with image.x = display.contentWidth - image.width ,
but display.contentWidth - image.width is just a calculated number too that always will be the value of display.contentWidth - image.width from the time you initiated that line of code.
as you programmed it, those coordinates wont change on a rotation of the device because your image.x is still carrying the value of the landscape width minus your image width (because your line that filled the x value was happening at landscape mode).
a simple variable, (as image.x essentially is), will never change by itself unless you make it change.
so it looks like your stuff got pushed out, but it essentially just stayed at the same position.
i hope i was able to help you and that my explaination was not too confusing,
have a nice day and happy programming,
Michael