Brush

Summary

The user's brush

Class Properties

NameReturn TypeDescription

timeSincePressed

number Read-only

Time in seconds since the brush trigger was last pressed

timeSinceReleased

number Read-only

Time in seconds since the brush trigger was last released

triggerIsPressed

boolean Read-only

Check whether the brush trigger is currently pressed

triggerPressedThisFrame

boolean Read-only

Check whether the brush trigger was pressed during the current frame

triggerReleasedThisFrame

boolean Read-only

Check whether the brush trigger was released during the current frame

distanceMoved

number Read-only

The distance moved by the brush

distanceDrawn

number Read-only

The distance drawn by the brush (i.e. distance since the trigger was last pressed)

position

Vector3 Read/Write

The 3D position of the Brush Controller's tip

rotation

Rotation Read/Write

The 3D orientation of the Brush Controller's tip

direction

Vector3 Read-only

The vector representing the forward direction of the brush

size

number Read/Write

The current brush size

pressure

number Read/Write

Brush pressure is determined by how far the trigger is pressed in

type

string Read/Write

The current brush type

types

string[] Read-only

All brush types available via the UI

speed

number Read-only

How fast the brush is currently moving

colorRgb

Color Read/Write

Gets or set brush color

colorHsv

Vector3 Read/Write

Gets or set brush color using a Vector3 representing hue, saturation and brightness

colorHtml

string Read/Write

The color of the brush as a valid HTML color string (either hex values or a color name)

lastColorPicked

Color Read-only

The last color picked by the brush.

LastColorPickedHsv

Vector3 Read-only

The last color picked by the brush in HSV.

currentPath

Path Read/Write

The current path of the brush. Assumes a stroke is in progress.

Class Methods

Brush:GetTypes(includeTags, excludeTags)

Brush types filtered by chosen tags

Returns: string[] (A filtered list of brush types)

Parameters:

NameTypeDefaultDescription

includeTags

string[]

Include brushes that have any of these tags

excludeTags

string[]

Exclude brushes that have any of these tags

Example

brushList = Brush:GetTypes({"audioreactive"}, {"particle"})

Brush:JitterColor()

Applies the current jitter settings to the brush color

Returns: nil

Example

Brush:JitterColor()

Brush:ResizeHistory(size)

Clears the history and sets it's size

Returns: nil

Parameters:

NameTypeDefaultDescription

size

number

How many frames of position/rotation to remember

Example

Brush:ResizeHistory(10)

Brush:SetHistorySize(size)

Sets the size of the history. Only clears it if the size has changed

Returns: nil

Parameters:

NameTypeDefaultDescription

size

number

How many frames of position/rotation to remember

Example

Brush:SetHistorySize(10)

Brush:GetPastPosition(back)

Recalls previous positions of the Brush from the history buffer

Returns: Vector3 (The position of the brush during the specified frame)

Parameters:

NameTypeDefaultDescription

back

number

How many frames back in the history to look

Example

Brush:GetPastPosition(3)

Brush:GetPastRotation(back)

Recalls previous orientations of the Brush from the history buffer

Returns: Rotation (The rotation of the brush during the specified frame)

Parameters:

NameTypeDefaultDescription

back

number

How many frames back in the history to look

Example

Brush:GetPastRotation(3)

Brush:ForcePaintingOn(active)

If set to true then the brush will draw strokes even if the trigger isn't being pressed.

Returns: nil

Parameters:

NameTypeDefaultDescription

active

boolean

True means forced painting, false is normal behaviour

Example

Brush:ForcePaintingOn(true)

Brush:ForcePaintingOff(active)

If set to true then the brush will stop drawing strokes even if the trigger is still pressed.

Returns: nil

Parameters:

NameTypeDefaultDescription

active

boolean

True means painting is forced off, false is normal behaviour

Example

Brush:ForcePaintingOff(true)

Brush:ForceNewStroke()

Forces the start of a new stroke - will stop painting this frame and start again the next.

Returns: nil

Example

Brush:ForceNewStroke()

Brush:GetShaderFloatParameters(type)

Gets a list of float property names for a brush

Returns: string[] (A list of float property names usable with Stroke:SetShaderFloat)

Parameters:

NameTypeDefaultDescription

type

string

The brush name

Example

Brush:GetShaderFloatParameters("Ink")

Brush:GetShaderColorParameters(type)

Gets a list of color property names for a brush

Returns: string[] (A list of color property names usable with Stroke:SetShaderColor)

Parameters:

NameTypeDefaultDescription

type

string

The brush name

Example

Brush:GetShaderColorParameters("Ink")

Brush:GetShaderTextureParameters(type)

Gets a list of texture property names for a brush

Returns: string[] (A list of texture property names usable with Stroke:SetShaderTexture)

Parameters:

NameTypeDefaultDescription

type

string

The brush name

Example

Brush:GetShaderTextureParameters("Ink")

Brush:GetShaderVectorParameters(type)

Gets a list of vector property names for a brush

Returns: string[] (A list of vector property names usable with Stroke:SetShaderVector)

Parameters:

NameTypeDefaultDescription

type

string

The brush name

Example

Brush:GetShaderVectorParameters("Ink")

Last updated