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
Stroke
chevron_left
Classes
struct
Stroke
Constructors
functions
Stroke
Properties
data_object
Alignment
data_object
Cap
data_object
DashLength
data_object
Fill
data_object
Gap
data_object
Join
data_object
MiterLimit
data_object
Offset
data_object
Style
data_object
Width
Methods
functions
WithAlignment
functions
WithCap
Static Properties
data_object
None
Static Methods
functions
Dashed
functions
Dotted
functions
Solid
Stroke
A stroke on a shape's path. Defaults to centered, with half its width on either side. Dimensions and dash phase are in drawing pixels. Defaults to no stroke.
struct
Sandbox
.
sealed
Sandbox.Engine
build
Constructors
1
Stroke
(
)
Creates a disabled stroke with an 8px dash length and 4px gap ready for patterned use.
data_object
Properties
10
Alignment
StrokeAlignment
Placement on closed shapes. Defaults to Center; ignored by open paths. Inside and outside strokes clip a double-width centered stroke to the selected side, including its dash caps and dots. Pattern distances follow the original boundary.
Cap
LineCap
Outward-facing caps at both ends of open paths and dash runs, without shortening heads on short runs. Closed paths have no endpoint caps; dots stay round.
DashLength
float
Dash centerline length in drawing pixels. Nonpositive or non-finite values produce a solid stroke.
Fill
Fill
Fill mapped across the whole undashed stroke's bounds, shared by all dashes and caps.
Gap
float
Gap between dash runs or dot edges. Negative gaps become zero; non-finite gaps produce a solid stroke.
Join
LineJoin
Joins between adjacent segments.
MiterLimit
float
Maximum miter length divided by half the width, before falling back to bevel. Clamped to at least 1; non-finite values use 4.
Offset
float
Phase along the path in drawing pixels. Wraps around the period; non-finite values become zero.
Style
BorderStyle
Style and spacing along the path. Generic paths support solid, dashed and dotted strokes; decorative styles render on inside rectangles with solid-color paint and fall back to solid elsewhere. Pattern geometry is cached; its memory cost grows with the number of dashes or dots. Patterns that exceed GPU buffer capacity throw ArgumentOutOfRangeException.
Width
float
Width in drawing pixels, placed according to Alignment. Nonpositive or non-finite widths disable the stroke.
functions
Methods
2
WithAlignment
(
alignment
)
Stroke
Returns a copy with the specified placement on closed shapes.
WithCap
(
cap
)
Stroke
Returns a copy with the specified caps at both ends of open paths and dash runs. Dots stay round.
data_object
Static Properties
1
None
Stroke
A disabled stroke. Equivalent to the default value.
functions
Static Methods
3
Dashed
(
fill
,
width
,
dashLength
,
gap
,
offset
)
Stroke
Creates a dashed stroke with butt caps and round joins. Dimensions are in drawing pixels.
Dotted
(
fill
,
width
,
gap
,
offset
)
Stroke
Creates round dots with diameter equal to the stroke width. Dimensions are in drawing pixels.
Solid
(
fill
,
width
)
Stroke
Creates a solid stroke with butt caps and round joins. Width is in drawing pixels.
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.