Garry's Mod Wiki

Garry's Mod Wiki

  boolean WEAPON:DoDrawCrosshair( number x, number y )

Description

Called when the crosshair is about to get drawn, and allows you to override it.

This function will not be called if SWEP.DrawCrosshair is set to false or if player is affected by Player:CrosshairDisable.

Arguments

1 number x
X coordinate of the crosshair.
2 number y
Y coordinate of the crosshair.

Returns

1 boolean
Return true to override the default crosshair.

Example

Draws an outlined rectangle in place of the crosshair.

function SWEP:DoDrawCrosshair( x, y ) surface.SetDrawColor( 0, 250, 255, 255 ) surface.DrawOutlinedRect( x - 32, y - 32, 64, 64 ) return true end

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...