# Sandbox.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.

- Kind: struct
- Namespace: `Sandbox`
- Assembly: `Sandbox.Engine`
- Modifiers: sealed

## Constructors

- [`Stroke`](/api/Sandbox.Stroke/.ctor): Creates a disabled stroke with an 8px dash length and 4px gap ready for patterned use.

## Properties

- [`Alignment`](/api/Sandbox.Stroke/Alignment): 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`](/api/Sandbox.Stroke/Cap): 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`](/api/Sandbox.Stroke/DashLength): Dash centerline length in drawing pixels. Nonpositive or non-finite values produce a solid stroke.
- [`Fill`](/api/Sandbox.Stroke/Fill): Fill mapped across the whole undashed stroke's bounds, shared by all dashes and caps.
- [`Gap`](/api/Sandbox.Stroke/Gap): Gap between dash runs or dot edges. Negative gaps become zero; non-finite gaps produce a solid stroke.
- [`Join`](/api/Sandbox.Stroke/Join): Joins between adjacent segments.
- [`MiterLimit`](/api/Sandbox.Stroke/MiterLimit): Maximum miter length divided by half the width, before falling back to bevel. Clamped to at least 1; non-finite values use 4.
- [`None`](/api/Sandbox.Stroke/None): A disabled stroke. Equivalent to the default value.
- [`Offset`](/api/Sandbox.Stroke/Offset): Phase along the path in drawing pixels. Wraps around the period; non-finite values become zero.
- [`Style`](/api/Sandbox.Stroke/Style): 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`](/api/Sandbox.Stroke/Width): Width in drawing pixels, placed according to Alignment. Nonpositive or non-finite widths disable the stroke.

## Methods

- [`Dashed`](/api/Sandbox.Stroke/Dashed): Creates a dashed stroke with butt caps and round joins. Dimensions are in drawing pixels.
- [`Dotted`](/api/Sandbox.Stroke/Dotted): Creates round dots with diameter equal to the stroke width. Dimensions are in drawing pixels.
- [`Solid`](/api/Sandbox.Stroke/Solid): Creates a solid stroke with butt caps and round joins. Width is in drawing pixels.
- [`WithAlignment`](/api/Sandbox.Stroke/WithAlignment): Returns a copy with the specified placement on closed shapes.
- [`WithCap`](/api/Sandbox.Stroke/WithCap): Returns a copy with the specified caps at both ends of open paths and dash runs. Dots stay round.
