Checks two sprites for collision, if they overlap then it returns True. Otherwise it returns False. No other information can be returned about this type of collision.
function CollidesWith(const Other: TAgkSprite): Boolean;
Parameters |
Description |
const Other: TAgkSprite |
the sprite to check for intersection with this sprite. |
This method is primarily for sprites that are not using physics. Whilst it can be used on physics sprites the physics system will have already calculated the overlap of all physics sprites during the last frame and stored the results in the contact list. This function actually does the calculation required to determine if the sprites overlap. This function is not limited by group or category settings.
This function only operates on the sprite's base shape. Any additional shapes added to physics sprites will not be used in this function, use PhysicsCollision or PhysicsCollidesWith instead.
If you have not assigned a shape to either sprite using Shape they will use the default box shape based on the sprite's width and height.
Copyright (c) 2012. All rights reserved.
|