Sorry to dig up an old topic. I've been working on an android based game for the past few weeks, and things seem to be going pretty well. The final hurdle is getting to to run on devices other than my own phone! I've made the screen scale (based on another ampos post - thank you!), and it works fine on a friends phone with a higher resolution than mine. The problem is tablets, I have two tablets one running android honeycomb and a new nexus 7. To try and work out what was happening I wrote this quick code based on that posted by ampos above. It displays the current xres and yres, then draws a rectangle to a virtual screen before scaling it to display on the real screen.
SETSCREEN 9000,9000,0
GLOBAL xres,yres
GETSCREENSIZE xres,yres
GLOBAL device$=PLATFORMINFO$("DEVICE")
PRINT "xres="+xres,10,10
PRINT "yres="+yres,10,30
PRINT "device="+device$,10,50
IF xres>yres
PRINT "Landscape",10,70
ELSEIF yres>xres
PRINT "Portrait",10,70
ELSE
PRINT "Square?",10,70
ENDIF
SHOWSCREEN
MOUSEWAIT
CREATESCREEN 1,100,800,480
USESCREEN 1
CLEARSCREEN RGB(0,0,255)
DRAWRECT 100,100,600,280,RGB(255,0,0)
PRINT "xres="+xres,10,10
PRINT "yres="+yres,10,30
PRINT "device="+device$,10,50
IF xres>yres
PRINT "Landscape",10,70
ELSEIF yres>xres
PRINT "Portrait",10,70
ELSE
PRINT "Square?",10,70
ENDIF
USESCREEN -1
CLEARSCREEN RGB(0,0,0)
STRETCHSPRITE 100,0,0,xres,yres
SHOWSCREEN
MOUSEWAIT
END
Both the tablets report landscape resolutions (i.e. xres > yres), but they fail completely to display the scaled rectangles. It works perfectly on my phone. In my game I get a display on the tablets, but it is rotated through 90 degrees (SETORIENTATION 3 made no difference).
Any ideas?
Thank you.