Nexus 7 (Android), scaling and createscreen issues

Previous topic - Next topic

planetm

I've been working on a game and it's pretty much ready to go, but I'm still having issues with scaling on tablets. I'm starting with a resolution of 800x480 (that was the resolution of the phone I started development on) and I'm trying to scale it up to run on the Nexus 7 (1280x800).

If I use SETSCREEN 9000,9000,0 and GETSCREENSIZE (as suggested elsewhere by Ampos, thank you) the nexus reports a landscape resolution. I've then tried scaling using createscreen, followed by either stretchsprite or polyvector but neither displays anything (although they work fine on windows). I just tried the code at http://www.glbasic.com/forum/index.php?topic=6998.msg57145#msg57145 and that shows a blue screen, but the small square doesn't display. My own example at http://www.glbasic.com/forum/index.php?topic=7043.msg70852#msg70852 displays a blank screen in the createscreen/stretchsprite section.

It seems that the problems I'm experiencing and similar to those people mention on Asus Transformer tablets, the Nexus is also manufactured by Asus. The Nexus 7 seems very popular now so i really would like to resolve this. Any ideas?

okee

Android: Samsung Galaxy S2 -  ZTE Blade (Orange San Francisco) - Ainol Novo 7 Aurora 2
IOS: 2 x Ipod Touch (1G)

r0ber7

Okee (who still has the best avatar ever) beat me to the punch. Ampos' z_project is great. It may take some time to change your code, but it's definitely worth it!  =D

planetm

Thanks okee and r0ber7 for the replies. I guess I can change my code to use this method, I've tried createscreen/stretchsprite, createscreen/polyvector and grabsprite methods already, nothing to lose except another hour of dev time!

Am I correct in assuming that CREATESCREEN is still not working correctly on all android platforms then?

spacefractal

#4
SETSCREEN does nothing on android, but you should try to set resolution to 9000x8999 (or something that is not samme numbers) in the projet setup. Then glbasic should create the screen in the correct maximum resolution.

You could also try to use android:screenOrientation="landscape" in manifest, which was required for me for Android.This because glbasic did not support any surface changes (which might have been happens) and then its have rotated wrong. So I hope there is not not that kind of issue? Howover that issue should been fixed in v11.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

planetm

I modified the code to use Ampos' z-project and after a few initial teething problems its working great. Also modified the manifest to force landscape play on the nexus 7, thanks to you all for the suggestions.

I still don't see why I couldn't use the createscreen method but at least I can work around it now.