Skip to main content
A scripted effect applied to a path For effects that can change over time, even when the path does not change, markNeedsAdvance() should be called on its context in the advance function For more information, see Path Effect Scripts.

Methods

init

init(self: T, context: Context) -> boolean
Called once when the effect is created or attached. Return true to keep the effect active, or false to disable it.
-- Called once when the script initializes.
function init(self: MyPathEffect, context: Context): boolean

    -- Return false to stop the script.
    return true
end

update

update(self: T, path: PathData, node: NodeReadData) -> PathData
Called any time an input changes. You receive the original PathData and must return the path that should be used for rendering.
function update(self: MyPathEffect, inPath: PathData): PathData
    local path = Path.new()
    return path
end

advance

advance(self: T, seconds: number) -> boolean
Called every frame to advance the effect over time. seconds is the time delta since the last frame. Return true to keep the effect active, or false to disable it.
function advance(self: MyPathEffect, seconds: number): boolean
  return false
end