We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi,
I was wondering what would be the easiest way to scale an Android Sketch to easily adapt to the display width and display height of an Android device. My sketch is 800x400 and I have tried the scale function without good results.
Is there any function to adapt an sketch to the phone screen automatically?
Answers
use
size(displayWidth, displayHeight);
in setup or omit the size entirely (the sketch should be fullscreen on Android then).
... yes, BUT if you have a device with software android buttons you must subtract the android button height from displayheight but I dont know how. for devices with hardware button outside the entire display, no problem with displayheight.
How can I get the usable displayheight an multiple android devices?
Klsc true, but aren't the buttons programmed to come to the top always? Which is why you can see them? I think display height and display width would be okay?
I have a program with size(displayWidth, displayHeight); orientation(PORTRAIT); and the android buttons are visible. I don't know how to hide them.
tested in emulator and nexus 7
I think that would be a problem with the Android's program, not yours. I think android made it so that buttons will be visible no matter what. How do the buttons affect your program? Maybe you can alter the code?
the back button close my app, home button bring it in background and the "active apps button" to. I go searching in the next days.