Stroke
class Stroke
An immutable object comprised of a StrokeInputBatch that represents a user-drawn (or sometimes synthetic) path, a Brush that contains information on how that path should be converted into a geometric shape and rendered on screen, and a PartitionedMesh which is the geometric shape calculated from the combination of the StrokeInputBatch and the Brush.
This can be constructed directly from a StrokeInputBatch that has already been completed. To construct a stroke incrementally and render it as input events are received in real time, use InProgressStrokesView or InProgressStroke, which will ultimately return a Stroke when input is completed.
Summary
Public constructors |
|---|
Stroke(brush: Brush, inputs: StrokeInputBatch)Construct a |
Stroke(brush: Brush, inputs: StrokeInputBatch, shape: PartitionedMesh)Construct a |
Public properties |
|
|---|---|
Brush |
Contains information on how the |
ImmutableStrokeInputBatch |
The user-drawn (or perhaps synthetically generated) path that this |
PartitionedMesh |
The geometric shape of the |
Public constructors
Stroke
Stroke(brush: Brush, inputs: StrokeInputBatch)
Construct a Stroke given a Brush and a StrokeInputBatch, generating its shape.
Stroke
Stroke(brush: Brush, inputs: StrokeInputBatch, shape: PartitionedMesh)
Construct a Stroke given a Brush, a StrokeInputBatch, and a PartitionedMesh.
Note that this does not do any validation that brush and inputs together would produce shape. This constructor is primarily intended for deserialization, in cases where the PartitionedMesh is being stored in addition to the Brush and StrokeInputBatch.
Public functions
Protected functions
Public properties
brush
val brush: Brush
Contains information on how the inputs should be used to calculate the shape and how that shape should be drawn on screen.
inputs
val inputs: ImmutableStrokeInputBatch
The user-drawn (or perhaps synthetically generated) path that this Stroke takes.
shape
val shape: PartitionedMesh
The geometric shape of the Stroke, which can be used to render it on screen and to perform geometric calculations. This PartitionedMesh will have one render group per brush coat in brush.