Programming a target in an Android Application


Last Updated:

  1. kingh32

    kingh32 New Member This Topic's Starter

    Joined:
    Aug 2, 2010
    Messages:
    2
    Likes Received:
    0
    Hello

    I'm currently trying to program a target as part of an Android Application.
    I want the user to be able to touch a particular band within the target with the app being able to acknowledge the area selected i.e. coordinates and put that data into a database.

    Does anyone have any suggestions as to how I can make an image of a target function in this way?

    The target is made up of 6-9 bands, each being the same width.

    Thanks

    Kingh32
     

    Advertisement
  2. id0001

    id0001 Well-Known Member

    Joined:
    Apr 20, 2010
    Messages:
    142
    Likes Received:
    23
    You can measure the distance between the center of your target and the touching point. That way you can calculate which band has been hit.

    hitBand = Math.floor(distance / bandWidth);

    ~id
     

Share This Page

Loading...