FabGL
ESP32 VGA Controller and Graphics Library

◆ updateAndDetectCollision() [2/2]

void fabgl::CollisionDetector::updateAndDetectCollision ( Sprite sprite,
CollisionDetectionCallback  callbackFunc,
void *  callbackObj 
)

Update collision detector and detect multiple collisions 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 multiple collisions.

Parameters
spriteThe sprite to update and to check for collisions.
callbackFuncThe callback function called whenever a collision is detected.
callbackObjPointer passed as parameter to the callback function.