Draw at (x,y) Coordinates


Last Updated:

  1. cmh0114

    cmh0114 Well-Known Member This Topic's Starter

    Joined:
    Jan 10, 2010
    Messages:
    116
    Likes Received:
    7
    Are there any methods for Android that will allow you to draw an image at a given (x,y) coordinate? I'm looking to use this for a game that has objects constantly flying across the screen. Instead of creating a separate layout for each instance of the loop, it will just recalculate the x,y coordinates of the object and redraw it when the window is refreshed at the next iteration.
    Of course, I'm open to other suggestions on how to do this as well. I'm new to programming for Droid, and I'm really unsure how to display images in many cases.
     

    Advertisement
  2. IanGClifton

    IanGClifton Well-Known Member

    Joined:
    Feb 7, 2010
    Messages:
    111
    Likes Received:
    19
    Use a Drawable class (like BitmapDrawable) and call setBounds with the coords, then call draw.
     

Share This Page

Loading...