input.SetCursorPos

From Garry's Mod
Jump to: navigation, search
 input.SetCursorPos( )

Contents

Description

Sets the cursor's position on the screen, relative to the topleft corner of the window

Arguments

number mouseX

X coordinate for mouse position

Arguments

number mouseY

Y coordinate for mouse position

Examples

Example

Makes the user's cursor circle their screen

hook.Add( 'HUDPaint', 'CircleScreen', function()
	input.SetCursorPos( ScrW()/2+math.sin(CurTime())*ScrW()/2, ScrH()/2+math.cos(CurTime())*ScrH()/2 )
end)


Personal tools
Navigation