Hi @rubenshcm,
When working with “letterbox” scale, I usually set two variables near the top of my code that I can use to calculate the width/height of the empty bars on any screen aspect ratio:
[lua]
local ox, oy = math.abs(display.screenOriginX), math.abs(display.screenOriginY)
[/lua]
Then, I use these elsewhere to adjust items toward one edge of the screen. For example, if you have 100x100 rectangle and you want its top edge to always meet the top edge of the screen, it might look like this:
[lua]
local r1 = display.newRect( 160, 50-oy, 100, 100 )
[/lua]
Or to make a rectangle’s left edge meet the left edge of the screen:
[lua]
local r2 = display.newRect( 50-ox, 240, 100, 100 )
[/lua]
Again, these variable represent the exact number of pixels (width and height) of the letterbox bars on any screen, so you can use them to position objects accordingly.
Hope this helps,
Brent