FabGL
ESP32 VGA Controller and Graphics Library

◆ updateAndDetectCollision() [1/2]

Sprite * fabgl::CollisionDetector::updateAndDetectCollision ( Sprite sprite,
bool  removeCollidingSprites = true 
)

Update collision detector and detect collision with the specified sprite.

When a sprite changes its position or size it is necessary to update the collision detector. This method updates the detector and detects collisions.

Parameters
spriteThe sprite to update and to check for collisions.
removeCollidingSpritesIf true the collided sprites are automatically removed from the collision detector.
Returns
The other sprite that collided with the specified sprite.