PlanBaseTestCollisionRect Method |
Determines whether the solidity rectangle of the specified sprite overlaps that
of any sprite in the specified category.
Namespace: (Default Namespace)Assembly: Default (in Default.exe) Version: 1.0.0.0
Syntax public virtual int TestCollisionRect(
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 This can be used to force a simple rectangular collision test even if one or both
sprites involved have a Mask Alpha level greater than 0. This method is recommended
for improved performance when pixel-perfect collision detection is not required.
See Also