A specific brush stroke
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 |
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 |
Stroke:SelectMultiple(0, 4) --Adds the first 5 strokes on the sketch
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 |
myStroke.ChangeMaterial("Light")
Deletes the current stroke
Returns: nil
myStroke:Delete()
Adds this stroke to the current selection
Returns: nil
myStroke:Select()
Removes this stroke from the current selection
Returns: nil
myStroke:Deselect()
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 |
newStroke = Stroke:Join(0, 10)
Joins a stroke with the previous stroke
Returns: Stroke
newStroke = myStroke:JoinPrevious()
Joins a stroke with the previous stroke
Returns: Stroke
Parameters:
Name | Type | Default | Description |
---|---|---|---|
stroke2 | Stroke | The stroke to join to this one |
newStroke = myStroke:JoinPrevious()
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 |
Stroke:MergeFrom(string name)
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) |
myStroke:SetShaderClipping(0.1, 0.9)
Changes a shader float parameter
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
parameter | string | The shader parameter name | |
value | number | The new value |
myStroke:SetShaderFloat("_EmissionGain", 0.5)
Changes a shader color parameter
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
parameter | string | The shader parameter name | |
color | Color | The new color |
myStroke:SetShaderColor("_TintColor", Color.red)
Changes a shader texture parameter
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
parameter | string | The shader parameter name | |
image | Image | The new image to use as a texture |
myStroke:SetShaderTexture("_MainTex", myImage)
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 |
myStroke:SetShaderVector("_TimeOverrideValue", 0.5, 0, 0, 0)