Barotrauma Client Doc
Barotrauma.GUIFont Class Reference
Inheritance diagram for Barotrauma.GUIFont:
Barotrauma.GUISelector< GUIFontPrefab >

Public Member Functions

 GUIFont (string identifier)
 
ScalableFont GetFontForStr (string str)
 
void DrawString (SpriteBatch sb, LocalizedString text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects spriteEffects, float layerDepth)
 
void DrawString (SpriteBatch sb, string text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects spriteEffects, float layerDepth)
 
void DrawString (SpriteBatch sb, LocalizedString text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects spriteEffects, float layerDepth, Alignment alignment=Alignment.TopLeft)
 
void DrawString (SpriteBatch sb, string text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects spriteEffects, float layerDepth, Alignment alignment=Alignment.TopLeft, ForceUpperCase forceUpperCase=Barotrauma.ForceUpperCase.Inherit)
 
void DrawString (SpriteBatch sb, LocalizedString text, Vector2 position, Color color, ForceUpperCase forceUpperCase=Barotrauma.ForceUpperCase.Inherit, bool italics=false)
 
void DrawString (SpriteBatch sb, string text, Vector2 position, Color color, ForceUpperCase forceUpperCase=Barotrauma.ForceUpperCase.Inherit, bool italics=false)
 
void DrawStringWithColors (SpriteBatch sb, string text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects spriteEffects, float layerDepth, in ImmutableArray< RichTextData >? richTextData, int rtdOffset=0, Alignment alignment=Alignment.TopLeft, ForceUpperCase forceUpperCase=Barotrauma.ForceUpperCase.Inherit)
 
Vector2 MeasureString (LocalizedString str, bool removeExtraSpacing=false)
 
Vector2 MeasureChar (char c)
 
string WrapText (string text, float width)
 
string WrapText (string text, float width, int requestCharPos, out Vector2 requestedCharPos)
 
string WrapText (string text, float width, out Vector2[] allCharPositions)
 
- Public Member Functions inherited from Barotrauma.GUISelector< GUIFontPrefab >
 GUISelector (string identifier)
 

Static Public Member Functions

static implicit operator ScalableFont (GUIFont reference)
 

Properties

bool HasValue [get]
 
ScalableFont Value [get]
 
bool ForceUpperCase [get]
 
uint Size [get]
 
float LineHeight [get]
 

Additional Inherited Members

- Public Attributes inherited from Barotrauma.GUISelector< GUIFontPrefab >
readonly PrefabSelector< T > Prefabs
 
readonly Identifier Identifier
 

Detailed Description

Definition at line 226 of file GUIPrefab.cs.

Constructor & Destructor Documentation

◆ GUIFont()

Barotrauma.GUIFont.GUIFont ( string  identifier)

Definition at line 228 of file GUIPrefab.cs.

Member Function Documentation

◆ DrawString() [1/6]

void Barotrauma.GUIFont.DrawString ( SpriteBatch  sb,
LocalizedString  text,
Vector2  position,
Color  color,
float  rotation,
Vector2  origin,
float  scale,
SpriteEffects  spriteEffects,
float  layerDepth,
Alignment  alignment = Alignment.TopLeft 
)

Definition at line 255 of file GUIPrefab.cs.

◆ DrawString() [2/6]

void Barotrauma.GUIFont.DrawString ( SpriteBatch  sb,
LocalizedString  text,
Vector2  position,
Color  color,
float  rotation,
Vector2  origin,
Vector2  scale,
SpriteEffects  spriteEffects,
float  layerDepth 
)

Definition at line 245 of file GUIPrefab.cs.

◆ DrawString() [3/6]

void Barotrauma.GUIFont.DrawString ( SpriteBatch  sb,
LocalizedString  text,
Vector2  position,
Color  color,
ForceUpperCase  forceUpperCase = Barotrauma.ForceUpperCase.Inherit,
bool  italics = false 
)

Definition at line 265 of file GUIPrefab.cs.

◆ DrawString() [4/6]

void Barotrauma.GUIFont.DrawString ( SpriteBatch  sb,
string  text,
Vector2  position,
Color  color,
float  rotation,
Vector2  origin,
float  scale,
SpriteEffects  spriteEffects,
float  layerDepth,
Alignment  alignment = Alignment.TopLeft,
ForceUpperCase  forceUpperCase = Barotrauma.ForceUpperCase.Inherit 
)

Definition at line 260 of file GUIPrefab.cs.

◆ DrawString() [5/6]

void Barotrauma.GUIFont.DrawString ( SpriteBatch  sb,
string  text,
Vector2  position,
Color  color,
float  rotation,
Vector2  origin,
Vector2  scale,
SpriteEffects  spriteEffects,
float  layerDepth 
)

Definition at line 250 of file GUIPrefab.cs.

◆ DrawString() [6/6]

void Barotrauma.GUIFont.DrawString ( SpriteBatch  sb,
string  text,
Vector2  position,
Color  color,
ForceUpperCase  forceUpperCase = Barotrauma.ForceUpperCase.Inherit,
bool  italics = false 
)

Definition at line 270 of file GUIPrefab.cs.

◆ DrawStringWithColors()

void Barotrauma.GUIFont.DrawStringWithColors ( SpriteBatch  sb,
string  text,
Vector2  position,
Color  color,
float  rotation,
Vector2  origin,
float  scale,
SpriteEffects  spriteEffects,
float  layerDepth,
in ImmutableArray< RichTextData >?  richTextData,
int  rtdOffset = 0,
Alignment  alignment = Alignment.TopLeft,
ForceUpperCase  forceUpperCase = Barotrauma.ForceUpperCase.Inherit 
)

Definition at line 275 of file GUIPrefab.cs.

◆ GetFontForStr()

ScalableFont Barotrauma.GUIFont.GetFontForStr ( string  str)

◆ MeasureChar()

Vector2 Barotrauma.GUIFont.MeasureChar ( char  c)

Definition at line 285 of file GUIPrefab.cs.

◆ MeasureString()

Vector2 Barotrauma.GUIFont.MeasureString ( LocalizedString  str,
bool  removeExtraSpacing = false 
)

Definition at line 280 of file GUIPrefab.cs.

◆ operator ScalableFont()

static implicit Barotrauma.GUIFont.operator ScalableFont ( GUIFont  reference)
static

◆ WrapText() [1/3]

string Barotrauma.GUIFont.WrapText ( string  text,
float  width 
)

◆ WrapText() [2/3]

string Barotrauma.GUIFont.WrapText ( string  text,
float  width,
int  requestCharPos,
out Vector2  requestedCharPos 
)

◆ WrapText() [3/3]

string Barotrauma.GUIFont.WrapText ( string  text,
float  width,
out Vector2[]  allCharPositions 
)

Property Documentation

◆ ForceUpperCase

bool Barotrauma.GUIFont.ForceUpperCase
get

Definition at line 236 of file GUIPrefab.cs.

◆ HasValue

bool Barotrauma.GUIFont.HasValue
get

Definition at line 230 of file GUIPrefab.cs.

◆ LineHeight

float Barotrauma.GUIFont.LineHeight
get

Definition at line 299 of file GUIPrefab.cs.

◆ Size

uint Barotrauma.GUIFont.Size
get

Definition at line 238 of file GUIPrefab.cs.

◆ Value

ScalableFont Barotrauma.GUIFont.Value
get

Definition at line 232 of file GUIPrefab.cs.