Hi everyone !
I think I might be about to ask a dummy question, but I'm still new with Android programming, and I couldn't (despite all my efforts) find my answer on Google.
The thing is, I'm trying to develop a little game, with 2D Graphics. I want my "gaming board" to be at a specific position on my screen, so that I can display in-game informations above and below the box. But since there is beginning to be a lot of Android phones out there, I was thinking about getting "dynamic" values so that I can adapt my font size to every device.
My game is not in full screen (but it could be, it's no big deal), but in a window with no title bar.
I'm using an extension of the default SurfaceView
class, implementing SurfaceHolder.Callback
. I tried writing the following method :
public void getViewSize()
{
VIEW_WIDTH = this.getWidth();
VIEW_HEIGHT = this.getHeight();
}
but the values returned are zeroes.
Anyone got an idea (even if it means changing display strategy) ? Thanks a lot.