It is totally doable. But you have to program it yourself.
It looks like you are going to ignore the iPhone, iPhone 3G and iPhone 3GS with 480x320 resolution, but that can be added later.
Let's assume:
1x = iPhone 4, iPhone 4S - 960x640
2x = iPhone 5 - 1136x640
3x = iPad 2, iPad mini - 1024x768
4x = iPad 3, iPad 4 - 2048x1536
The first step is to detect the actual resolution of the device (sample code in Tier 1, same commands for Tier 2, just add 'agk::' before and ';' after, and change the variable definition):
chkVal as Integer
// get the widest value
if GetDeviceWidth() > GetDeviceHeight()
chkVal = GetDeviceWidth()
else
chkVal = GetDeviceHeight()
endif
You figure out whether you are on an iPad or iPhone device:
// get the device
devName as String
devName = GetDeviceName()
// figure out if iPad
devType as String
devType = Mid(devName,5,4)
Now figure out what resolution
addToImg as String
if devType = "iPad"
if chkVal > 1024
// iPad 3/4
addToImg = "4x"
else
// iPad 2/mini
addToImg = "3x"
endif
else
if chkVal > 960
// iPhone 5
addToImg = "2x"
else
// iPhone 4/4S
addToImg = ""
endif
endif
Then you do all your image loads building the names something like "someAssetName"+addToImg+".png".
You can create functions to do the setup and then do the image load:
function getDeviceInfo()
// we want this value as a global
global addToImg as String
// some local variables
chkVal as Integer
devName as String
// get the widest value to compare to
// (the iPhone 4 and iPhone 5 have the same width)
if GetDeviceWidth() > GetDeviceHeight()
chkVal = GetDeviceWidth()
else
chkVal = GetDeviceHeight()
endif
// get the device name
devName = GetDeviceName()
// figure out if iPad
devType = Mid(devName,5,4)
if devType = "iPad"
if chkVal > 1024
// iPad 3/4
addToImg = "4x"
else
// iPad 2/mini
addToImg = "3x"
endif
else
if chkVal > 960
// iPhone 5
addToImg = "2x"
else
// iPhone 4/4S
addToImg = ""
endif
endif
endfunction
function loadMyImage(basename as String)
// we want this value as a global
global addToImg as String
// local variables
imgID as Integer
imgName as String
// build the name
imgName = basename + addToImg + ".png"
// load the image
// assumes is in the media directory
imgID = LoadImage(imgName)
endfunction imgID
Now, these are very simple functions and could be added to. For instance, you could pass the directory to use for loading images and you should check to see if it exists.
Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master