[Resolved] Test if user is on iPhone or iPad?

I cannot seem to phrase this right in my search on these forums so I will ask here:

I have a universal build. On iPhone, my ship goes left and right to edge of screen like space invaders. I use 0 and display.contentWidth to determine the barriers. On iPad however, since it is wider it does not reach the end of the screen.

I have config set to letterbox as I do not want to stretch my art. I made all of the images wide enough to cover the iPad view & get rid of the black space. I just need to be able to extend the ship movement barriers if user is on iPad.

How can I do this? [import]uid: 22392 topic_id: 26749 reply_id: 326749[/import]

I used to use this code to check what device the user was on, but it might be outdated now. Anyway here it is

local x = display.contentScaleX  
local y = display.contentScaleY  
if (x == 0.5 and y == 0.5) then  
 \_G.isiPhone4 = true  
 \_G.isRegulariPhone = false  
elseif(x ~= 1 and x ~= 0.5 and y ~= 1 and y ~= 0.5) then  
 \_G.isiPad = true  
elseif(x ~= 1 and y ~= 1) then  
 \_G.isRegulariPhone = false  
end  

Also this was before the iPad 3 came out so don’t know if it’ll work for that device [import]uid: 14018 topic_id: 26749 reply_id: 108522[/import]

Thanks… worked like a charm! [import]uid: 22392 topic_id: 26749 reply_id: 108533[/import]