1. Download our Official Android App: Forums for Android!

Apps Drawing in the correct location in games

Discussion in 'Android Development' started by qoncept, Nov 12, 2009.

  1. qoncept

    qoncept Newbie
    Thread Starter

    Nov 8, 2009
    I'm playing with the Lunar Lander sample code to get a better understanding of how to draw the graphics in a 2d game (my background is more in GUI and database). One thing I've never quite understood is the positioning of an object.

    The little bit I've done in the past (on PCs) is making sure I have a set width window. Then I move my objects around on a pixel grid. What is the best practice for placing an object when the screen can be different resolutions? I want the game to be the same on every platform, so do I draw it normally and transform the entire canvas? Is there a better reference for location than pixels? Looking at the Lunar Lander code, I'm having a hard time determining how it actually sets the position and whether it would look the same at different resolutions. Thanks in advance!


Share This Page