Here's a quick demo of what I hope is the percentage resolution, if you have any questions, just ask.
rem
rem AGK Application
rem
rem Portrait App
// get device heights and widths
global fDeviceHeight as float
fDeviceHeight = GetDeviceHeight()
global fDeviceWidth as float
fDeviceWidth = GetDeviceWidth()
// use percentage resolution
SetDisplayAspect( fDeviceWidth / fDeviceHeight )
// get the virtual resolutions
global fVirtualWidth as integer
fVirtualWidth = fDeviceWidth
global fVirtualHeight as integer
fVirtualHeight = fDeviceHeight
// set values for the percentages
fPercentageWidth as float = 100.0
fPercentageHeight as float = 100.0
// load an image and create a sprite
iMyImage = LoadImage("adgbadge2.png")
iMySprite = CreateSprite( iMyImage )
fMySpriteWidth as float
fMySpriteWidth = GetSpriteWidth( iMySprite )
// get the scale ratio
fScaleRatio as float
fScaleRatio = fPercentageWidth / fVirtualWidth
// scale the sprite (comment this out to see the difference)
SetSpriteScale(iMySprite, fScaleRatio, fScaleRatio)
// get pixel to percentage ratios
fWidthPixelPercentageRatio as float
fWidthPixelPercentageRatio = fPercentageWidth / fVirtualWidth
fHeightPixelPercentageRatio as float
fHeightPixelPercentageRatio = fPercentageHeight / fVirtualHeight
// position sprite (comment out either one to see the difference)
// by percentage
//SetSpritePosition( iMySprite, 50, 50)
// by pixel
SetSpritePosition( iMySprite, 50 * fWidthPixelPercentageRatio, 50 * fHeightPixelPercentageRatio)
rem A Wizard Did It!
do
Sync()
loop
Try it with your own images because I'd like to thoroughly test it! Remember to change the name of the image your loading and that should be all you have to change.
Edit: I forgot to mention that this code will scale the sprites to their original size. So if you make a sprite of 100x100, this will scale it so that it appears at 100x100 pixels on the screen. Come to think of it, I'm not sure how helpful this will be when it comes to different resolutions...