s&
About
The Project
info
About s&box
map
Roadmap
monitoring
Metrics
Engine startup and usage numbers
Updates
newspaper
Latest News
published_with_changes
Changes
Release-by-release changelog
Games
Browse Games
Discover Games
gamejams
live now
Game Jam III
Ends
Fri 25 Sep
Theme
One More Round
The jam is running. Build something, or play the entries.
£
50,000
prizepool
View the jam
Workshop
Playable
sports_esports
Games
Standalone games and gamemodes
Assets
landscape
Maps
view_in_ar
Models
texture
Materials
apparel
Clothing
apps
Everything
Every asset type in one list
Forum
Learn
Documentation
rocket_launch
Getting Started
docs
Documentation
api
API Reference
Resources
school
Tutorials
manage_search
Code Search
input
Log in with Steam
chevron_left
Change Language
简体中文
English
Русский
Español
Português-Brasil
Deutsch
日本語
Français
Polski
Türkçe
한국어
Pirate
Italiano
ไทย
繁體中文
Українська
Čeština
Nederlands
Magyar
Dansk
Suomi
Svenska
Norsk
Ελληνικά
Română
Български
Tiếng Việt
Bahasa Indonesia
Español-Latinoamérica
العربية
Api
Classes
TextStyle
chevron_left
Classes
struct
TextStyle
Constructors
functions
TextStyle
Properties
data_object
Alignment
data_object
Color
data_object
FontName
data_object
FontSize
data_object
FontWeight
data_object
Italic
data_object
LetterSpacing
data_object
LineHeight
data_object
Outline
data_object
Shadow
data_object
WordSpacing
Methods
functions
WithAlignment
functions
WithBold
functions
WithColor
functions
WithFont
functions
WithItalic
functions
WithLetterSpacing
functions
WithLineHeight
functions
WithOutline
functions
WithoutOutline
functions
WithoutShadow
functions
WithShadow
functions
WithSize
functions
WithWeight
functions
WithWordSpacing
Static Properties
data_object
Default
TextStyle
Text settings for Painter.
struct
Sandbox
.
sealed
Sandbox.Engine
build
Constructors
1
TextStyle
(
)
Creates TextStyle.Default: white, 16px Roboto with normal weight and top-left alignment. Unlike default(TextStyle), this constructor initializes the font and layout settings.
data_object
Properties
11
Alignment
TextFlag
Alignment and layout flags used within the destination rectangle.
Color
Color
Text color. Its alpha combines with drawing and panel opacity.
FontName
string
Font family, with the engine's usual fallback for unavailable fonts.
FontSize
float
Font size in pixels, scaled by the panel's ScaleToScreen.
FontWeight
int
Font weight from 1 to 1000. Normal is 400, bold is 700.
Italic
bool
Use an italic face.
LetterSpacing
float
Additional spacing between letters, in pixels before ScaleToScreen.
LineHeight
float
Line height multiplier, where 1 uses the font's normal line height.
Outline
Outline
One outline, with stroke width in pixels before ScaleToScreen. Disabled by default.
Shadow
Shadow
One drop shadow, with blur and offset in pixels before ScaleToScreen. Disabled by default.
WordSpacing
float
Additional spacing between words, in pixels before ScaleToScreen.
functions
Methods
14
WithAlignment
(
alignment
)
TextStyle
Returns a copy with alignment and layout flags for the destination rectangle.
WithBold
(
bold
)
TextStyle
Returns a copy with bold (700) or normal (400) weight.
WithColor
(
color
)
TextStyle
Returns a copy with a text color. Alpha applies to the text and its effects together.
WithFont
(
fontName
,
size
,
weight
)
TextStyle
WithItalic
(
italic
)
TextStyle
Returns a copy with italic enabled or disabled.
WithLetterSpacing
(
spacing
)
TextStyle
Returns a copy with additional spacing between letters, in pixels before ScaleToScreen.
WithLineHeight
(
height
)
TextStyle
Returns a copy with a line-height multiplier.
WithOutline
(
color
,
width
)
TextStyle
WithoutOutline
(
)
TextStyle
Returns a copy without its outline.
WithoutShadow
(
)
TextStyle
Returns a copy without its drop shadow.
WithShadow
(
color
,
blur
,
offset
)
TextStyle
WithSize
(
size
)
TextStyle
Returns a copy with a font size in pixels before ScaleToScreen.
WithWeight
(
weight
)
TextStyle
Returns a copy with a font weight from 1 to 1000.
WithWordSpacing
(
spacing
)
TextStyle
Returns a copy with additional spacing between words, in pixels before ScaleToScreen.
data_object
Static Properties
1
Default
TextStyle
White, 16px Roboto with normal weight and top-left alignment.
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.