Returns X coordinate of last image collision (world space, set by b2dIsImagesColliding/Simple, use after detecting collision).
Takes no parameters.
Returns X coordinate of last image collision (world space, set by b2dIsImagesColliding/Simple, use after detecting collision).
2D Overlay
Parameters & Returns
Parameters
This function takes no parameters.
Returns
Int
Quick Summary
Returns X coordinate of last image collision (world space, set by b2dIsImagesColliding/Simple, use after detecting collision).
Takes no parameters.
Returns X coordinate of last image collision (world space, set by b2dIsImagesColliding/Simple, use after detecting collision).
Technical Exegesis...
Returns X coordinate of last image collision (world space, set by b2dIsImagesColliding/Simple, use after detecting collision). Takes no parameters. Returns X coordinate (integer pixels, world/screen space), returns last stored value (from most recent b2dIsImagesColliding or b2dIsImagesCollidingSimple call that found collision). Reads g_2D_lastImageCollisionX (global variable updated by collision functions).
Returns X coordinate of last image collision (world space, set by b2dIsImagesColliding/Simple, use after detecting collision). Takes no parameters. Returns X coordinate (integer pixels, world/screen space), returns last stored value (from most recent b2dIsImagesColliding or b2dIsImagesCollidingSimple call that found collision). Reads g_2D_lastImageCollisionX (global variable updated by collision functions). Use to spawn effects at collision point (particles, sounds, explosions), calculate collision response (bounce direction, knockback), or debug visualization (draw marker at collision). Collision point storage: updated when b2dIsImagesColliding or b2dIsImagesCollidingSimple returns 1 (only on collision, not on no-collision), stores first overlap pixel found (not center or average, deterministic first match in pixel scan), world space coordinates (position in screen/world coordinate system, matches render positions). Use cases: (1) Spawn particle (If b2dIsImagesColliding(...) Then BBR_CreateParticle(b2dGetImageCollisionX(), b2dGetImageCollisionY())), (2) Play sound (If collision Then PlaySound3D(\"impact.wav\", b2dGetImageCollisionX(), b2dGetImageCollisionY())), (3) Debug draw (If collision Then b2dDrawCircle(b2dGetImageCollisionX(), b2dGetImageCollisionY(), 5)), (4) Knockback direction (colX=b2dGetImageCollisionX(): colY=b2dGetImageCollisionY(): dx=playerX-colX: dy=playerY-colY: knockback in direction). Common patterns: retrieve point = If b2dIsImagesColliding(...) Then x=b2dGetImageCollisionX(): y=b2dGetImageCollisionY(): use coordinates; pair with Y = always call both X and Y getters to get full 2D point. Value persistence: stored until next collision (value remains until b2dIsImagesColliding/Simple updates it again), no automatic reset (doesn't clear to 0 after query, persistent across frames), undefined if no collision yet (if no collision function called since program start, value may be 0 or uninitialized). Performance: cost zero (simple global variable read, trivial operation), safe to call frequently (can query multiple times per frame without overhead). Related: b2dGetImageCollisionY (pair with this function for full 2D collision point), b2dIsImagesColliding (sets collision point when detects collision with rotation/scale), b2dIsImagesCollidingSimple (sets collision point when detects collision without transforms).