Skip navigation
Nickoby
Currently Being Moderated

AS 3 Object Hit Test question

May 20, 2012 9:21 AM

I am working on a tennis game. I have designed a two -dimensional court with each of the individual parts of the court (eg right service court) as an instance of a movie clip. I want to distort the court so that the far end looks farther away - the court becomes a trapezium. When detecting whether the ball lands on a particular court section, is the hit test done on the original two-dimensional shape or on the distorted shape?

 
Replies
  • kglad
    72,182 posts
    Jul 21, 2002
    Currently Being Moderated
    May 20, 2012 10:01 AM   in reply to Nickoby

    unless you use the bitmapdata hittest, you'll be checking for a hit of the bounding rectangle and it does not matter what the original shape is.  if you want a pixel-perfect hittest, you'll need to use the bitmapdata hittest.

     
    |
    Mark as:
  • kglad
    72,182 posts
    Jul 21, 2002
    Currently Being Moderated
    May 20, 2012 3:56 PM   in reply to Nickoby

    you're welcome.

     

    p.s.  please mark helpful/correct responses, if there are any.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points