FabGL
ESP32 VGA Controller and Graphics Library

◆ detectCollision() [2/2]

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

Detect multiple collisions with the specified sprite.

It is necessary to call CollisionDetector.update() before detectCollision() so sprites position and size are correctly updated.

Parameters
spriteThe sprite to detect collision.
callbackFuncThe callback function called whenever a collision is detected.
callbackObjPointer passed as parameter to the callback function.