SpriteBaseTestCollisionMask Method |
Determine whether the sprite's collision mask is overlapping part of any sprite in the specified category.
Namespace: (Default Namespace)Assembly: Default (in Default.exe) Version: 1.0.0.0
Syntax public virtual int TestCollisionMask(
SpriteCollection Targets
)
Parameters
- Targets
- Type: (Default Namespace)SpriteCollection
A sprite category containing sprites that will be checked for collision
with this sprite.
Return Value
Type:
Int32The index of the sprite within the category if a collision is occurring, otherwise -1.
Remarks The collision mask is derived from the sprite's Mask Alpha Level setting.
If both sprites have a collision mask, they are checked for overlapping solid bits.
If one sprite has Mask Alpha Level set to 0, then a rectangular mask for that sprite
is synthesized from the solid width and solid height using
GetRectangularMask(Size).
If both sprites have Mask Alpha Level set to 0, then a simple rectangular collision
detection is performed (for improved performance).
See Also