Skip to content

Latest commit

 

History

History
195 lines (81 loc) · 4.52 KB

File metadata and controls

195 lines (81 loc) · 4.52 KB

StrokeList

Summary

The list of Strokes in the scene. (You don't instantiate this yourself. Access this via Sketch.strokes)

Instance Properties

NameReturn TypeDescription
lastSelectedStroke
Read-only
Returns the last stroke that was selected
lastStroke
Read-only
Returns the last Stroke
this[index]Stroke
Read-only
Returns the Stroke at the given index
countnumber
Read-only
The number of strokes

Instance Methods

strokeList:Select()

Adds these strokes to the current selection

Returns: nil

Example

myStrokes:Select()

strokeList:Deselect()

Removes these strokes from the current selection

Returns: nil

Example

myStrokes:Deselect()

strokeList:Delete()

Deletes all the strokes in the list

Returns: nil

Example

myStrokes:Delete()

strokeList:SetShaderClipping(clipStart, clipEnd)

Hides the section of the stroke that is outside the specified range

Returns: nil

Parameters:

NameTypeDefaultDescription
clipStartnumberThe amount of the stroke to hide from the start (0-1)
clipEndnumberThe amount of the stroke to hide from the end (0-1)

Example

myStroke:SetShaderClipping(0.1, 0.9)

strokeList:SetShaderFloat(parameter, value)

Changes a shader float parameter.

Returns: nil

Parameters:

NameTypeDefaultDescription
parameterstringThe shader parameter name
valuenumberThe new value

Example

myStrokes:SetShaderFloat("_EmissionGain", 0.5)

strokeList:SetShaderColor(parameter, color)

Changes a shader color parameter

Returns: nil

Parameters:

NameTypeDefaultDescription
parameterstringThe shader parameter name
colorColorThe new color

Example

myStrokes:SetShaderColor("_TintColor", Color.red)

strokeList:SetShaderTexture(parameter, image)

Changes a shader texture parameter

Returns: nil

Parameters:

NameTypeDefaultDescription
parameterstringThe shader parameter name
imageImageThe new image to use as a texture

Example

myStrokes:SetShaderTexture("_MainTex", myImage)

strokeList:SetShaderVector(parameter, x, y, z, w)

Changes a shader vector parameter

Returns: nil

Parameters:

NameTypeDefaultDescription
parameterstringThe shader parameter name
xnumberThe new x value
ynumber0The new y value
znumber0The new z value
wnumber0The new w value

Example

myStrokes:SetShaderVector("_TimeOverrideValue", 0.5, 0, 0, 0)