Crosshair draws a dynamic crosshair: a center dot with four bars whose gap widens with the
distance to what the player is aiming at.
It is hidden while the player is running or dead, and whenever the ShouldHUDPaint or
ShouldHUDPaintCrosshair hook returns false. Plugins change its color and gap through the
AdjustCrosshairColor and AdjustCrosshairGap hooks; the plugin itself uses them to tint
and narrow the crosshair when the player aims at a nearby player or item.
Summary
Hooks
Hooks
Implements hook AdjustCrosshairColor
Tints the crosshair with the theme's accent color when the local player aims at a player or an item that is less than 600 units away.
Parameters
- trace Map trace result of the local player's aim
- distance Number distance from the local player to the trace hit position
Returns
- Color the accent color, or nil to keep the default color
Implements hook AdjustCrosshairGap
Narrows the crosshair when the local player aims at a player or an item that is less than 600 units away.
Parameters
- trace Map trace result of the local player's aim
- distance Number distance from the local player to the trace hit position
Returns
- Number a gap of 8, or nil to keep the distance-based gap
Draws the crosshair: a center dot and four bars around it. Gap and color can be changed through the AdjustCrosshairGap and AdjustCrosshairColor hooks.
Implements hook ShouldHUDPaintCrosshair
Hides the crosshair while the local player is running, dead or not yet initialized.
Returns
- Boolean false to hide the crosshair, nil otherwise