[flexcoders] bitmap hitTest method

2008-02-20 Thread n3moncic
Hi,

my question is about basically pixel level collision.

lets say I have two Image display objects and I get it's bitmap Data
respectively for the first one and the 2nd one.

Below is the code
--
var shipBmpData:BitmapData = new
BitmapData(shipBox.width,shipBox.height,false,0);
shipBmpData.draw(shipBox);
var hitImageBmpData:BitmapData = new
BitmapData(shipBoxHit.width,shipBoxHit.height,false,0);
hitImageBmpData.draw(shipBoxHit);


if (hitImageBmpData.hitTest(new
Point(shipBoxHit.x,shipBoxHit.y),255,shipBmpData,new
Point(shipBox.x,shipBox.y),255))
{
Alert.show(quot;final hitquot;);
}
--

I cannot understand why I can't exact pixel level detection. Basically
one of them is moving towards the other and when it is over it, it
should detect collision.

Can anyone give the correct way? I want to get a collision at pixel level.

Thanks in advance!





[flexcoders] Re: bitmap hitTest method

2008-02-20 Thread n3moncic
Hi Tom Chiverton,

Actually it took me a while to understand that hitTestObject doesn't
work for me because both DisplayObjects may be rotated and
hitTestObject takes into consideration transparent pixels.

What do you think about pixel collision?




--- In flexcoders@yahoogroups.com, Tom Chiverton [EMAIL PROTECTED]
wrote:

 On Wednesday 20 Feb 2008, n3moncic wrote:
  one of them is moving towards the other and when it is over it, it
  should detect collision.
 
 You don't need hitTest() here, do you, because you know where they
both are 
 and their size... ?
 
 -- 
 Tom Chiverton
 Helping to paradigmatically lead industry-wide developments
 on: http://thefalken.livejournal.com
 
 
 
 This email is sent for and on behalf of Halliwells LLP.
 
 Halliwells LLP is a limited liability partnership registered in
England and Wales under registered number OC307980 whose registered
office address is at Halliwells LLP, 3 Hardman Square, Spinningfields,
Manchester, M3 3EB.  A list of members is available for inspection at
the registered office. Any reference to a partner in relation to
Halliwells LLP means a member of Halliwells LLP.  Regulated by The
Solicitors Regulation Authority.
 
 CONFIDENTIALITY
 
 This email is intended only for the use of the addressee named above
and may be confidential or legally privileged.  If you are not the
addressee you must not read it and must not use any information
contained in nor copy it nor inform any person other than Halliwells
LLP or the addressee of its existence or contents.  If you have
received this email in error please delete it and notify Halliwells
LLP IT Department on 0870 365 2500.
 
 For more information about Halliwells LLP visit www.halliwells.com.





[flexcoders] Re: bitmap hitTest method

2008-02-20 Thread n3moncic
Hi again,

but getObjectsUnderPoint() wouldn't that mean under a particular x y
point? It wouldn't be that accurate since a DisplayObject has many
points. What do you think?

It thought hitTest method would mean pixel level detection.

Thanks!


--- In flexcoders@yahoogroups.com, Tom Chiverton [EMAIL PROTECTED]
wrote:

 On Wednesday 20 Feb 2008, n3moncic wrote:
  Actually it took me a while to understand that hitTestObject doesn't
  work for me because both DisplayObjects may be rotated and
  hitTestObject takes into consideration transparent pixels.
 
 Ahh.
 getObjectsUnderPoint() ?
 
 -- 
 Tom Chiverton
 Helping to dramatically develop B2B e-business
 on: http://thefalken.livejournal.com
 
 
 
 This email is sent for and on behalf of Halliwells LLP.
 
 Halliwells LLP is a limited liability partnership registered in
England and Wales under registered number OC307980 whose registered
office address is at Halliwells LLP, 3 Hardman Square, Spinningfields,
Manchester, M3 3EB.  A list of members is available for inspection at
the registered office. Any reference to a partner in relation to
Halliwells LLP means a member of Halliwells LLP.  Regulated by The
Solicitors Regulation Authority.
 
 CONFIDENTIALITY
 
 This email is intended only for the use of the addressee named above
and may be confidential or legally privileged.  If you are not the
addressee you must not read it and must not use any information
contained in nor copy it nor inform any person other than Halliwells
LLP or the addressee of its existence or contents.  If you have
received this email in error please delete it and notify Halliwells
LLP IT Department on 0870 365 2500.
 
 For more information about Halliwells LLP visit www.halliwells.com.





[flexcoders] Re: bitmap hitTest method

2008-02-20 Thread n3moncic
Thanks very much,

I will take it a look.

--- In flexcoders@yahoogroups.com, Daniel Freiman [EMAIL PROTECTED] wrote:

 I don't have time to follow all the links but it looks like this
post might
 get you to the solution:
 
 http://troygilbert.com/category/game-dev/
 
 - Dan Freiman
 
 On Wed, Feb 20, 2008 at 10:01 AM, n3moncic [EMAIL PROTECTED] wrote:
 
Hi again,
 
  but getObjectsUnderPoint() wouldn't that mean under a particular x y
  point? It wouldn't be that accurate since a DisplayObject has many
  points. What do you think?
 
  It thought hitTest method would mean pixel level detection.
 
  Thanks!
 
 
  --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Tom
  Chiverton tom.chiverton@
  wrote:
  
   On Wednesday 20 Feb 2008, n3moncic wrote:
Actually it took me a while to understand that hitTestObject
doesn't
work for me because both DisplayObjects may be rotated and
hitTestObject takes into consideration transparent pixels.
  
   Ahh.
   getObjectsUnderPoint() ?
  
   --
   Tom Chiverton
   Helping to dramatically develop B2B e-business
   on: http://thefalken.livejournal.com
  
   
  
   This email is sent for and on behalf of Halliwells LLP.
  
   Halliwells LLP is a limited liability partnership registered in
  England and Wales under registered number OC307980 whose registered
  office address is at Halliwells LLP, 3 Hardman Square, Spinningfields,
  Manchester, M3 3EB. A list of members is available for inspection at
  the registered office. Any reference to a partner in relation to
  Halliwells LLP means a member of Halliwells LLP. Regulated by The
  Solicitors Regulation Authority.
  
   CONFIDENTIALITY
  
   This email is intended only for the use of the addressee named above
  and may be confidential or legally privileged. If you are not the
  addressee you must not read it and must not use any information
  contained in nor copy it nor inform any person other than Halliwells
  LLP or the addressee of its existence or contents. If you have
  received this email in error please delete it and notify Halliwells
  LLP IT Department on 0870 365 2500.
  
   For more information about Halliwells LLP visit www.halliwells.com.