Blitz3D+ Command Reference

ShowPointer

Parameters

None.

Description

Shows the system mouse pointer again after it has been hidden.

This is the other half of HidePointer. Use it whenever an ordinary arrow is the right thing for the player to see: an options screen, a level editor, a pause menu, or the moment your game drops out of a mouse-look camera.

It works in both windowed and full-screen modes. Full-screen modes hide the pointer for you when the graphics mode opens, so a full-screen menu that wants a real arrow has to ask for it with ShowPointer; closing the graphics mode brings it back automatically either way.

Visibility is a simple on/off flag rather than a counter, so a single ShowPointer restores the arrow however many times you hid it, and calling it when the pointer is already visible does nothing.

Showing the pointer does not change the mouse input at all - MouseX, MouseY and MouseDown behave the same whether the arrow is drawn or not.

See also: HidePointer, MoveMouse, MouseX, MouseY, Graphics.

Example

; ShowPointer Example
; -------------------

Graphics 640,480,0,2
SetBuffer BackBuffer()

; Start with the Windows pointer hidden so ShowPointer has
; something to reveal. (Windowed modes only; see also HidePointer.)
HidePointer
hidden=1

While Not KeyDown(1)

    Cls

    ; Space toggles between ShowPointer and HidePointer
    If KeyHit(57) Then
        hidden=1-hidden
        If hidden Then
            HidePointer
        Else
            ShowPointer ; the documented command - reveal the pointer
        End If
    End If

    If hidden Then
        ; While hidden, a game crosshair stands in for the pointer
        Color 255,255,0
        Oval MouseX()-10,MouseY()-10,20,20,False
        Line MouseX()-14,MouseY(),MouseX()+14,MouseY()
        Line MouseX(),MouseY()-14,MouseX(),MouseY()+14
        Color 255,255,255
    End If

    Text 0,0,"Space: toggle ShowPointer / HidePointer   Esc: exit"
    If hidden Then
        Text 0,20,"Pointer hidden - press Space to call ShowPointer"
    Else
        Text 0,20,"ShowPointer called - the Windows pointer is back"
    End If

    Flip

Wend

End

Index