Class: BrushPrototype
Rendering.2D.BrushPrototype(shape, sizeopt)
Strokes drawn with this brush will be drawn using polygon as a shape
Constructor
new BrushPrototype(shape, sizeopt)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
shape | Polygon|PathBuilding.Polygon|URI|Rendering.2D.Brush2D.ShapeDescriptor | Polygon shape, required for non particles strokes.Polygon shape shoud be centered in rect with left: -0.5, top: -0.5, right: 0.5, bottom: 0.5. | ||
size | float | <optional> | 1 | Min stroke size applier. Multiple shapes for Brush2D requires different sizes which defines ranges. |
Properties:
Name | Type | Description |
---|---|---|
shape | PathBuilding.Polygon | |
encoding | Serialization.TypedArrayCodec.Encoding | Applicable for JSON serialization, configures shape serialization type |
Since:
- 3.0
Methods
toJSON() → {JSON}
Serialize to JSON
Returns:
BrushPrototype data
Type
JSON
(static) create(type, size, …shapeArgs) → Rendering.2D.BrushPrototype
BrushPrototype factory, based on shape description
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type | BrushPrototype.Type | |||
size | float | 0 | Applicable for mipmap functionality, should be 0 when mipmap is not available | |
shapeArgs | VarArgs.<float> | <repeatable> | ShapeFactory class factory method arguments |
Returns:
BrushPrototype instance
Type
(static) fromJSON(data) → Rendering.2D.BrushPrototype
Deserialize from JSON
Parameters:
Name | Type | Description |
---|---|---|
data | JSON | BrushPrototype data |
Returns:
BrushPrototype instance
Type