TextStyleclass
Text settings for Painter.
Constructors3
Showing 3 constructors
No results match this filter.
Methods15
Showing 15 methods
public Sandbox.TextStyle WithAlignment(Sandbox.TextFlag alignment)
Returns a copy with alignment and layout flags for the destination rectangle.
| Parameter | Type | Description |
|---|---|---|
| alignment | TextFlag | — |
public Sandbox.TextStyle WithBold(bool bold = True)
Returns a copy with bold (700) or normal (400) weight.
| Parameter | Type | Description |
|---|---|---|
| bold = True | bool | — |
public Sandbox.TextStyle WithColor(Color color)
Returns a copy with a text color. Alpha applies to the text and its effects together.
| Parameter | Type | Description |
|---|---|---|
| color | Color | — |
public Sandbox.TextStyle WithFont(string fontName, System.Nullable`1<float> size = null, System.Nullable`1<int> weight = null)
| Parameter | Type | Description |
|---|---|---|
| fontName | string | — |
| size = null | Nullable<float> | — |
| weight = null | Nullable<int> | — |
public Sandbox.TextStyle WithItalic(bool italic = True)
Returns a copy with italic enabled or disabled.
| Parameter | Type | Description |
|---|---|---|
| italic = True | bool | — |
public Sandbox.TextStyle WithLetterSpacing(float spacing)
Returns a copy with additional spacing between letters, in pixels before ScaleToScreen.
| Parameter | Type | Description |
|---|---|---|
| spacing | float | — |
public Sandbox.TextStyle WithLineHeight(float height)
Returns a copy with a line-height multiplier.
| Parameter | Type | Description |
|---|---|---|
| height | float | — |
public Sandbox.TextStyle WithOutline(System.Nullable`1<Color> color = null, float width = 1)
| Parameter | Type | Description |
|---|---|---|
| color = null | Nullable<Color> | — |
| width = 1 | float | — |
public Sandbox.TextStyle WithSize(float size)
Returns a copy with a font size in pixels before ScaleToScreen.
| Parameter | Type | Description |
|---|---|---|
| size | float | — |
public Sandbox.TextStyle WithWeight(int weight)
Returns a copy with a font weight from 1 to 1000.
| Parameter | Type | Description |
|---|---|---|
| weight | int | — |
No results match this filter.
Properties12
Showing 12 properties
public Sandbox.TextFlag Sandbox.TextStyle.Alignment { get; set; }
Alignment and layout flags used within the destination rectangle.
public Color Sandbox.TextStyle.Color { get; set; }
Text color. Its alpha combines with drawing and panel opacity.
public static Sandbox.TextStyle Sandbox.TextStyle.Default { get; set; }
White, 16px Roboto with normal weight and top-left alignment.
public string Sandbox.TextStyle.FontName { get; set; }
Font family, with the engine's usual fallback for unavailable fonts.
string—public float Sandbox.TextStyle.FontSize { get; set; }
Font size in pixels, scaled by the panel's ScaleToScreen.
float—public int Sandbox.TextStyle.FontWeight { get; set; }
Font weight from 1 to 1000. Normal is 400, bold is 700.
int—public bool Sandbox.TextStyle.Italic { get; set; }
Use an italic face.
bool—public float Sandbox.TextStyle.LetterSpacing { get; set; }
Additional spacing between letters, in pixels before ScaleToScreen.
float—public float Sandbox.TextStyle.LineHeight { get; set; }
Line height multiplier, where 1 uses the font's normal line height.
float—public Sandbox.TextRendering.Outline Sandbox.TextStyle.Outline { get; set; }
One outline, with stroke width in pixels before ScaleToScreen. Disabled by default.
public Sandbox.TextRendering.Shadow Sandbox.TextStyle.Shadow { get; set; }
One drop shadow, with blur and offset in pixels before ScaleToScreen. Disabled by default.
public float Sandbox.TextStyle.WordSpacing { get; set; }
Additional spacing between words, in pixels before ScaleToScreen.
float—No results match this filter.