Barotrauma Client Doc
Barotrauma.ScalableFont Class Reference
Inheritance diagram for Barotrauma.ScalableFont:

Public Member Functions

 ScalableFont (ContentXElement element, uint defaultSize=14, GraphicsDevice gd=null)
 
 ScalableFont (string filename, uint size, GraphicsDevice gd=null, bool dynamicLoading=false, TextManager.SpeciallyHandledCharCategory speciallyHandledCharCategory=TextManager.SpeciallyHandledCharCategory.None)
 
void DrawString (SpriteBatch sb, string text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects se, float layerDepth, Alignment alignment=Alignment.TopLeft, ForceUpperCase forceUpperCase=Barotrauma.ForceUpperCase.Inherit)
 
void DrawString (SpriteBatch sb, string text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects se, float layerDepth, Alignment alignment=Alignment.TopLeft, ForceUpperCase forceUpperCase=Barotrauma.ForceUpperCase.Inherit)
 
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 se, float layerDepth, in ImmutableArray< RichTextData >? richTextData, int rtdOffset=0, Alignment alignment=Alignment.TopLeft, ForceUpperCase forceUpperCase=Barotrauma.ForceUpperCase.Inherit)
 
void DrawStringWithColors (SpriteBatch sb, string text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects se, float layerDepth, in ImmutableArray< RichTextData >? richTextData, int rtdOffset=0, Alignment alignment=Alignment.TopLeft, ForceUpperCase forceUpperCase=Barotrauma.ForceUpperCase.Inherit)
 
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)
 
Vector2 MeasureString (LocalizedString str, bool removeExtraSpacing=false)
 
Vector2 MeasureString (string text, bool removeExtraSpacing=false)
 
Vector2 MeasureChar (char c)
 
void Dispose ()
 

Static Public Member Functions

static TextManager.SpeciallyHandledCharCategory ExtractShccFromXElement (XElement element)
 

Public Attributes

bool ForceUpperCase = false
 

Properties

bool DynamicLoading [get]
 
TextManager.SpeciallyHandledCharCategory SpeciallyHandledCharCategory [get]
 
uint Size [get, set]
 
float LineHeight [get]
 

Detailed Description

Definition at line 15 of file ScalableFont.cs.

Constructor & Destructor Documentation

◆ ScalableFont() [1/2]

Barotrauma.ScalableFont.ScalableFont ( ContentXElement  element,
uint  defaultSize = 14,
GraphicsDevice  gd = null 
)

Definition at line 102 of file ScalableFont.cs.

◆ ScalableFont() [2/2]

Barotrauma.ScalableFont.ScalableFont ( string  filename,
uint  size,
GraphicsDevice  gd = null,
bool  dynamicLoading = false,
TextManager.SpeciallyHandledCharCategory  speciallyHandledCharCategory = TextManager.SpeciallyHandledCharCategory.None 
)

Definition at line 112 of file ScalableFont.cs.

Member Function Documentation

◆ Dispose()

void Barotrauma.ScalableFont.Dispose ( )

Definition at line 827 of file ScalableFont.cs.

◆ DrawString() [1/3]

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

Definition at line 536 of file ScalableFont.cs.

◆ DrawString() [2/3]

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

Definition at line 496 of file ScalableFont.cs.

◆ DrawString() [3/3]

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

Definition at line 550 of file ScalableFont.cs.

◆ DrawStringWithColors() [1/2]

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

Definition at line 602 of file ScalableFont.cs.

◆ DrawStringWithColors() [2/2]

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

Definition at line 607 of file ScalableFont.cs.

◆ ExtractShccFromXElement()

static TextManager.SpeciallyHandledCharCategory Barotrauma.ScalableFont.ExtractShccFromXElement ( XElement  element)
static

◆ MeasureChar()

Vector2 Barotrauma.ScalableFont.MeasureChar ( char  c)

Definition at line 813 of file ScalableFont.cs.

◆ MeasureString() [1/2]

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

Definition at line 768 of file ScalableFont.cs.

◆ MeasureString() [2/2]

Vector2 Barotrauma.ScalableFont.MeasureString ( string  text,
bool  removeExtraSpacing = false 
)

Definition at line 773 of file ScalableFont.cs.

◆ WrapText() [1/3]

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

◆ WrapText() [2/3]

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

◆ WrapText() [3/3]

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

Member Data Documentation

◆ ForceUpperCase

bool Barotrauma.ScalableFont.ForceUpperCase = false

Definition at line 60 of file ScalableFont.cs.

Property Documentation

◆ DynamicLoading

bool Barotrauma.ScalableFont.DynamicLoading
get

Definition at line 35 of file ScalableFont.cs.

◆ LineHeight

float Barotrauma.ScalableFont.LineHeight
get

Definition at line 62 of file ScalableFont.cs.

◆ Size

uint Barotrauma.ScalableFont.Size
getset

Definition at line 47 of file ScalableFont.cs.

◆ SpeciallyHandledCharCategory

TextManager.SpeciallyHandledCharCategory Barotrauma.ScalableFont.SpeciallyHandledCharCategory
get

Definition at line 41 of file ScalableFont.cs.