1. Are you ready for the Galaxy S20? Here is everything we know so far!

Programming a target in an Android Application

Discussion in 'Android Development' started by kingh32, Aug 2, 2010.

  1. kingh32

    kingh32 Lurker
    Thread Starter

    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
     



    1. Download the Forums for Android™ app!


      Download

       
  2. id0001

    id0001 Well-Known Member

    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
     
Loading...

Share This Page

Loading...