Ok, so I’ve read a lot of beginner tutorials, watched a lot of videos and think I’m now ready to start making the basics of my first app, a simple sound board to learn the basics of Corona with. Which I can then build up into a half decent app.
I’m trying it make it with Resolution Independance and have it working referring to different scaled images fine. I’ve read and watched the provided tutorials on the subject.
I just want to check I’m doing the positioning properly.
To make sure the buttons will be positioned properly on any device, apple phones, ipads, android phones and tabled.
Is it best to do the postioning, using divisions of the display.content width and height as below:
--Below creates an attribute which contains the devices height and the devices width
local \_H = display.contentHeight;
local \_W = display.contentWidth;
-- load in backgorund image, with retina functionality by using display.newImageRect, and is centred
local background01 = display.newImageRect( "images/background.png", 320, 480)
background01:setReferencePoint(display.CenterReferencePoint);
background01.x = \_W/2; background01.y = \_H/2;
local button\_up = display.newImageRect( "images/button\_up.png", 140, 42)
button\_up:setReferencePoint(display.CenterReferencePoint);
button\_up.x = \_W/1.3; button\_up.y = \_H/2;
or to use the display width and height + a number of pixels to get the position correct, or will that muck up at times? (please note the numbers I’ve typed in are for example only)
–Below creates an attribute which contains the devices height and the devices width
[code]
local _H = display.contentHeight;
local _W = display.contentWidth;
– load in backgorund image, with retina functionality by using display.newImageRect, and is centred
local background01 = display.newImageRect( “images/background.png”, 320, 480)
background01:setReferencePoint(display.CenterReferencePoint);
background01.x = _W/+25; background01.y = _H/-100;
local button_up = display.newImageRect( “images/button_up.png”, 140, 42)
button_up:setReferencePoint(display.CenterReferencePoint);
button_up.x = _W/+50; button_up.y = _H/-120; [/code]
I hope this all makes sense, its my first proper Corona related question… so please go easy on me… [import]uid: 47346 topic_id: 8819 reply_id: 308819[/import]