Skip to content

raylib.CheckCollisionPointLine

JoeStrout edited this page Apr 29, 2026 · 2 revisions

Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold]

Parameters

Parameter Default Value Note
point
p1
p2
threshold

Return value

Condition Return Value
(always) number

Notes

Example

// Check if a point is within 5 pixels of the line
hit = raylib.CheckCollisionPointLine([205, 150], [100, 100], [300, 200], 5)
if hit then print "Point is near the line!"

Clone this wiki locally