Stroke List

Summary

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

Instance Properties

NameReturn TypeDescription

lastSelected

Stroke Read-only

Returns the last stroke that was selected

last

Stroke Read-only

Returns the last Stroke

this[index]

Stroke Read-only

Returns the Stroke at the given index

count

number 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

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

myStroke:SetShaderClipping(0.1, 0.9)

strokeList:SetShaderFloat(parameter, value)

Changes a shader float parameter.

Returns: nil

Parameters:

NameTypeDefaultDescription

parameter

string

The shader parameter name

value

number

The new value

Example

myStrokes:SetShaderFloat("_EmissionGain", 0.5)

strokeList:SetShaderColor(parameter, color)

Changes a shader color parameter

Returns: nil

Parameters:

NameTypeDefaultDescription

parameter

string

The shader parameter name

color

The new color

Example

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

strokeList:SetShaderTexture(parameter, image)

Changes a shader texture parameter

Returns: nil

Parameters:

NameTypeDefaultDescription

parameter

string

The shader parameter name

image

The 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

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

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

Last updated