WEAPON:DoDrawCrosshair

From Garry's Mod
Jump to: navigation, search
 WEAPON:DoDrawCrosshair( )

Contents

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 set to false.

Arguments

number x

X coordinate of the crosshair.

Arguments

number y

Y coordinate of the crosshair.

Returns

boolean

Return true to override the default crosshair.

Examples

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


Personal tools
Navigation