I hadn't noticed this before, so it might be an issue with my code (that I cannot see). The virtual resolution doesn't seem to work for my overlay sprites. I have an image then some sprites on top to show the "click areas". The overlay sprites are oversized even though I am using the size of the original sprite as a reference.
The only time this works correctly is when the device resolution (in setup.agc) matches the virtual resolution.
imgSprite = CreateSprite(LoadImage ("L0_1.jpg"))
SetSpritePosition(imgSprite,screenWidth/2-GetSpriteWidth(imgSprite)/2,screenHeight/2-GetSpriteHeight(imgSprite)/2)
GLOBAL imageLeft
GLOBAL imageUpper
GLOBAL imageLower
GLOBAL imageRight
imageLeft=screenWidth/2-GetSpriteWidth(imgSprite)/2
imageUpper=screenHeight/2-GetSpriteHeight(imgSprite)/2
imageLower=imageUpper+GetSpriteHeight(imgSprite)
imageRight=imageLeft+GetSpriteWidth(imgSprite)
rem 0=LEFT,1=RIGHT ,2=UP ,3=DOWN ,4=CENTER
rem click areas
perHeight as FLOAT=1.0
perWidth as FLOAT=0.06
if show_clickArea=1
leftClick=DrawAreaBox(GetSpriteWidth(imgSprite),GetSpriteHeight(imgSprite),perWidth,perHeight)
left_clickArea= CreateSprite(leftClick)
SetSpritePosition(left_clickArea,imageLeft,imageUpper)
endif
click[0]._Left=imageLeft
click[0]._Upper=imageUpper
click[0]._Right=click[0]._Left+GetSpriteWidth(imgSprite)*perWidth
click[0]._Lower=click[0]._Upper+GetSpriteHeight(imgSprite)*perHeight
DrawAreaBox()
FUNCTION DrawAreaBox(boxWidth,boxHeight,percentWidth as float,percentHeight as float)
swap()
xOffset=1
yOffset=1
DrawLine( xOffset, yOffset, xOffset, boxHeight*percentHeight, 255, 255, 255 )
Update(0)
Render()
DrawLine( xOffset, boxHeight*percentHeight, boxWidth*percentWidth, boxHeight*percentHeight, 255, 255, 255 )
Update(0)
Render()
DrawLine( boxWidth*percentWidth, boxHeight*percentHeight, boxWidth*percentWidth, yOffset, 255, 255, 255 )
Update(0)
Render()
DrawLine( boxWidth*percentWidth, yOffset, xOffset,yOffset, 255, 255, 255 )
Update(0)
Render()
areaImage=GetImage(0,0,boxWidth+1,boxHeight+1)
ENDFUNCTION areaImage
I am using AppGameKit V108 beta 19. V2 alpha does not work on android yet so I cannot check if that works.
www.mindsclay.com
lucifermagus.mindsclay.com (not working with Firefox)