Barotrauma Client Doc
Barotrauma.Widget Class Reference

Public Types

enum class  Shape { Rectangle , Circle , Cross }
 

Public Member Functions

 Widget (string id, int size, Shape shape)
 
virtual void Update (float deltaTime)
 
virtual void Draw (SpriteBatch spriteBatch, float deltaTime)
 

Public Attributes

Shape shape
 
LocalizedString tooltip
 
bool showTooltip = true
 
int size = 10
 
float thickness = 1f
 
int sides = 40
 Used only for circles. More...
 
bool isFilled
 Currently used only for rectangles. More...
 
int inputAreaMargin
 
Color color = GUIStyle.Red
 
Color? secondaryColor
 
Color textColor = Color.White
 
Color textBackgroundColor = Color.Black * 0.5f
 
readonly string id
 
bool RequireMouseOn = true
 
Action refresh
 
object data
 
Vector2? tooltipOffset
 
Widget linkedWidget
 

Static Public Attributes

static List< WidgetselectedWidgets = new List<Widget>()
 

Properties

Rectangle DrawRect [get]
 
Rectangle InputRect [get]
 
Vector2 DrawPos [get, set]
 
bool IsSelected [get]
 
bool IsControlled [get]
 
bool IsMouseOver [get]
 
bool Enabled [get, set]
 
static bool EnableMultiSelect [get, set]
 

Events

Action Selected
 
Action Deselected
 
Action Hovered
 
Action MouseUp
 
Action MouseDown
 
Action< float > MouseHeld
 
Action< float > PreUpdate
 
Action< float > PostUpdate
 
Action< SpriteBatch, float > PreDraw
 
Action< SpriteBatch, float > PostDraw
 

Detailed Description

Definition at line 10 of file Widget.cs.

Member Enumeration Documentation

◆ Shape

Enumerator
Rectangle 
Circle 
Cross 

Definition at line 12 of file Widget.cs.

Constructor & Destructor Documentation

◆ Widget()

Barotrauma.Widget.Widget ( string  id,
int  size,
Shape  shape 
)

Definition at line 104 of file Widget.cs.

Member Function Documentation

◆ Draw()

virtual void Barotrauma.Widget.Draw ( SpriteBatch  spriteBatch,
float  deltaTime 
)
virtual

Definition at line 152 of file Widget.cs.

◆ Update()

virtual void Barotrauma.Widget.Update ( float  deltaTime)
virtual

Definition at line 111 of file Widget.cs.

Member Data Documentation

◆ color

Color Barotrauma.Widget.color = GUIStyle.Red

Definition at line 45 of file Widget.cs.

◆ data

object Barotrauma.Widget.data

Definition at line 66 of file Widget.cs.

◆ id

readonly string Barotrauma.Widget.id

Definition at line 49 of file Widget.cs.

◆ inputAreaMargin

int Barotrauma.Widget.inputAreaMargin

Definition at line 44 of file Widget.cs.

◆ isFilled

bool Barotrauma.Widget.isFilled

Currently used only for rectangles.

Definition at line 43 of file Widget.cs.

◆ linkedWidget

Widget Barotrauma.Widget.linkedWidget

Definition at line 100 of file Widget.cs.

◆ refresh

Action Barotrauma.Widget.refresh

Definition at line 64 of file Widget.cs.

◆ RequireMouseOn

bool Barotrauma.Widget.RequireMouseOn = true

Definition at line 62 of file Widget.cs.

◆ secondaryColor

Color? Barotrauma.Widget.secondaryColor

Definition at line 46 of file Widget.cs.

◆ selectedWidgets

List<Widget> Barotrauma.Widget.selectedWidgets = new List<Widget>()
static

Definition at line 102 of file Widget.cs.

◆ shape

Shape Barotrauma.Widget.shape

Definition at line 19 of file Widget.cs.

◆ showTooltip

bool Barotrauma.Widget.showTooltip = true

Definition at line 21 of file Widget.cs.

◆ sides

int Barotrauma.Widget.sides = 40

Used only for circles.

Definition at line 39 of file Widget.cs.

◆ size

int Barotrauma.Widget.size = 10

Definition at line 34 of file Widget.cs.

◆ textBackgroundColor

Color Barotrauma.Widget.textBackgroundColor = Color.Black * 0.5f

Definition at line 48 of file Widget.cs.

◆ textColor

Color Barotrauma.Widget.textColor = Color.White

Definition at line 47 of file Widget.cs.

◆ thickness

float Barotrauma.Widget.thickness = 1f

Definition at line 35 of file Widget.cs.

◆ tooltip

LocalizedString Barotrauma.Widget.tooltip

Definition at line 20 of file Widget.cs.

◆ tooltipOffset

Vector2? Barotrauma.Widget.tooltipOffset

Definition at line 98 of file Widget.cs.

Property Documentation

◆ DrawPos

Vector2 Barotrauma.Widget.DrawPos
getset

Definition at line 33 of file Widget.cs.

◆ DrawRect

Rectangle Barotrauma.Widget.DrawRect
get

Definition at line 22 of file Widget.cs.

◆ Enabled

bool Barotrauma.Widget.Enabled
getset

Definition at line 72 of file Widget.cs.

◆ EnableMultiSelect

bool Barotrauma.Widget.EnableMultiSelect
staticgetset

Definition at line 86 of file Widget.cs.

◆ InputRect

Rectangle Barotrauma.Widget.InputRect
get

Definition at line 23 of file Widget.cs.

◆ IsControlled

bool Barotrauma.Widget.IsControlled
get

Definition at line 69 of file Widget.cs.

◆ IsMouseOver

bool Barotrauma.Widget.IsMouseOver
get

Definition at line 70 of file Widget.cs.

◆ IsSelected

bool Barotrauma.Widget.IsSelected
get

Definition at line 68 of file Widget.cs.

Event Documentation

◆ Deselected

Action Barotrauma.Widget.Deselected

Definition at line 52 of file Widget.cs.

◆ Hovered

Action Barotrauma.Widget.Hovered

Definition at line 53 of file Widget.cs.

◆ MouseDown

Action Barotrauma.Widget.MouseDown

Definition at line 55 of file Widget.cs.

◆ MouseHeld

Action<float> Barotrauma.Widget.MouseHeld

Definition at line 56 of file Widget.cs.

◆ MouseUp

Action Barotrauma.Widget.MouseUp

Definition at line 54 of file Widget.cs.

◆ PostDraw

Action<SpriteBatch, float> Barotrauma.Widget.PostDraw

Definition at line 60 of file Widget.cs.

◆ PostUpdate

Action<float> Barotrauma.Widget.PostUpdate

Definition at line 58 of file Widget.cs.

◆ PreDraw

Action<SpriteBatch, float> Barotrauma.Widget.PreDraw

Definition at line 59 of file Widget.cs.

◆ PreUpdate

Action<float> Barotrauma.Widget.PreUpdate

Definition at line 57 of file Widget.cs.

◆ Selected

Action Barotrauma.Widget.Selected

Definition at line 51 of file Widget.cs.