Skip to content

matekdev/sbox-crosshair

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

sbox-crosshair

A semi-complete and configurable crosshair system built for s&box

Installation

Drag the ui folder into the code folder of your gamemode. Ex. minimal/code/ui

Usage

Add the following to the setup of your main gamemode hud.

RootPanel.AddChild<Crosshair>();
public MinimalHudEntity()
{
  if ( IsClient )
  {
    RootPanel.SetTemplate( "/minimalhud.html" );

    RootPanel.AddChild<ChatBox>();

    RootPanel.AddChild<Crosshair>();
  }
}

Call SetupCrosshair and optionally provide some properties. The properties follow a very similar structure to CS:GO.

Crosshair.Current?.SetupCrosshair(new Crosshair.Properties(
  true,
  false,
  false,
  25,
  2,
  2,
  -25,
  new Color(0.1f, 1f, 0.3f, 1f)
));

Full usage...

public MinimalHudEntity()
{
  if ( IsClient )
  {
    RootPanel.SetTemplate( "/minimalhud.html" );

    RootPanel.AddChild<ChatBox>();

    RootPanel.AddChild<Crosshair>().SetupCrosshair(new Crosshair.Properties());
  }
}

Examples

Example 1 crosshair Example 2 crosshair Example 3 crosshair

About

Crosshair system built for s&box

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published