You can do it in two ways:
- prepare table with positions for all you buttons and ui objects and have seperate table for mobile and desktop. This way you have the same objects but with one simple way you can adjust positions using reference from table.
- would be to prepare just views without any logic and have different view loaded based on the platform. MVC style.
Version with table is simpler I think. It would look something like that:
local ui\_pos = { mobile = { button\_1 = {x = 10, y = 20}, button\_2 = {x = 20, y = 50} }, desktop = { button\_1 = {x = 10, y = 120}, button\_2 = {x = 20, y = 150} }, } local platform = "mobile" -- user with if and system info to decide which platform to set. local button\_1 = display.newRect( ui\_pos[platform].button\_1.x, ui\_pos[platform].button\_1.y, 100, 100 )