Stroke
Summary
A specific brush stroke
Instance Properties
Name | Return Type | Description |
---|---|---|
path | Path Read/Write | The control points of this stroke from a Path |
brushType | string Read/Write | The stroke's brush type |
brushSize | number Read/Write | The stroke's size |
brushColor | Color Read/Write | The stroke's Color |
layer | Layer Read/Write | The layer the stroke is on |
group | Group Read/Write | The group this stroke is part of |
this[index] | Transform Read/Write | Gets or sets a control point by index |
count | number Read-only | The number of control points in this stroke |
Class Methods
Stroke:SelectRange(from, to)
Adds multiple strokes to the current selection
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
from | number | Start stroke index (0 is the first stroke that was drawn | |
to | number | End stroke index |
Example
Instance Methods
stroke:ChangeMaterial(brushName)
Assigns the material from another brush type to this stroke (Experimental. Results are unpredictable and are not saved with the scene)
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
brushName | string | The name (or guid) of the brush to get the material from |
Example
stroke:Delete()
Deletes the current stroke
Returns: nil
Example
stroke:Select()
Adds this stroke to the current selection
Returns: nil
Example
stroke:Deselect()
Removes this stroke from the current selection
Returns: nil
Example
stroke:JoinRange(from, to)
Joins joins multiple strokes into one stroke
Returns: Stroke
Parameters:
Name | Type | Default | Description |
---|---|---|---|
from | number | Start stroke index (0 is the first stroke that was drawn | |
to | number | End stroke index |
Example
stroke:JoinToPrevious()
Joins a stroke with the previous stroke
Returns: Stroke
Example
stroke:Join(stroke2)
Joins a stroke with the previous stroke
Returns: Stroke
Parameters:
Name | Type | Default | Description |
---|---|---|---|
stroke2 | The stroke to join to this one |
Example
stroke:MergeFrom(name)
Imports the file with the specified name from the user's Sketches folder and merges it's strokes into the current sketch
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
name | string | Name of the file to be merged |
Example
stroke:SetShaderClipping(clipStart, clipEnd)
Hides the section of the stroke that is outside the specified range
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
clipStart | number | The amount of the stroke to hide from the start (0-1) | |
clipEnd | number | The amount of the stroke to hide from the end (0-1) |
Example
stroke:SetShaderFloat(parameter, value)
Changes a shader float parameter
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
parameter | string | The shader parameter name | |
value | number | The new value |
Example
stroke:SetShaderColor(parameter, color)
Changes a shader color parameter
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
parameter | string | The shader parameter name | |
color | The new color |
Example
stroke:SetShaderTexture(parameter, image)
Changes a shader texture parameter
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
parameter | string | The shader parameter name | |
image | The new image to use as a texture |
Example
stroke:SetShaderVector(parameter, x, y, z, w)
Changes a shader vector parameter
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
parameter | string | The shader parameter name | |
x | number | The new x value | |
y | number | 0 | The new y value |
z | number | 0 | The new z value |
w | number | 0 | The new w value |
Example
Last updated