PlanBaseTestCollisionMask Method |
Determines whether the specified 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(
SpriteBase SourceSprite,
SpriteCollection Targets
)
Parameters
- SourceSprite
- Type: (Default Namespace)SpriteBase
A sprite that will be checked for collisions - Targets
- Type: (Default Namespace)SpriteCollection
A category of sprites against which collisions will be tested
Return Value
Type:
Int32The 0-based index of the sprite within
Targets if a collision is occurring, otherwise -1.
Remarks The collision mask is derived from the sprite's Mask Alpha Level setting.
If both sprites being tested 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