mr. nom button position

Forum for the book "Beginning Android Games", see

mr. nom button position

Postby simondid » Wed Nov 02, 2011 7:12 pm


first off all graeat book!! :-)


so im at page 230 and im just playing around with the MainMenuScreen and im wundring how i can find the ordinates off a arena for a a new button ore some thing like that??
Posts: 26
Joined: Wed Nov 02, 2011 7:10 pm

Re: mr. nom button position

Postby morcejo » Tue Nov 22, 2011 12:06 pm

Hello simondid, in this example (Mr.Nom) all the coordinates are referred to 320 px Width x 480 px Height screen, as defined in AndroidGame class. This class scales the device resolution using the framebuffer, so you can create your game assuming that the resolution is fixed to 320x480.

So if you put an image at 0,0 it will be at top left corner, at 160,240 will be at center position.

I hope this helps you
Posts: 11
Joined: Tue Nov 22, 2011 9:47 am

Return to Beginning Android Games

Who is online

Users browsing this forum: No registered users and 1 guest