Skip to content

raylib.IsCursorOnScreen

JoeStrout edited this page Apr 29, 2026 · 2 revisions

Check if cursor is on the current screen

Parameters

None.

Return value

Condition Return Value
(always) number

Notes

Example

raylib.InitWindow 800, 600, "Cursor On Screen Demo"
while not raylib.WindowShouldClose
    raylib.BeginDrawing
    raylib.ClearBackground color.white
    if raylib.IsCursorOnScreen then
        raylib.DrawText "Cursor is on screen", 10, 10, 20, color.green
    else
        raylib.DrawText "Cursor is off screen", 10, 10, 20, color.red
    end if
    raylib.EndDrawing
end while
raylib.CloseWindow

Clone this wiki locally