Skip to content

Sketch

Sketch is an experimental addon for Processing-style creative coding in PlayMaker.

Import the Sketch addon from the Addons Browser. If you want ready-made examples, also import Sketch Samples.

Sketch actions draw onto a Sketch Component, which creates a runtime canvas you can show with a SpriteRenderer, RawImage, or material texture.

Workflow

Most Sketch FSMs follow the same pattern:

  1. Add a Sketch Component to the GameObject you want to draw on.
  2. Use Sketch Create Canvas or Sketch Size to create the canvas.
  3. Set colors with Sketch Background, Sketch Fill, and Sketch Stroke.
  4. Draw shapes with point, line, rect, circle, ellipse, or plot actions.
  5. Read coordinates with the mouse/transform helper actions when you want interactive sketches.

Action Groups

Canvas

Sketch Create Canvas

Create a sketch canvas with a specific width and height.

Sketch Size

Processing-style alias for creating a sketch canvas.

Sketch Get Texture

Get the generated canvas texture for use in other actions.

Background And Style

Sketch Background

Set and clear the canvas to a background color.

Sketch Clear

Clear the canvas using the current background color.

Sketch Fade

Fade the current image back toward the background color.

Sketch Fill

Set the fill color for shapes.

Sketch No Fill

Turn off filled interiors for later shapes.

Sketch Stroke

Set the stroke color for lines and outlines.

Sketch No Stroke

Turn off outlines, lines, and points.

Sketch Stroke Weight

Set line and outline thickness in sketch pixels.

Drawing

Sketch Point

Draw a single point.

Sketch Line

Draw a line between two points.

Sketch Plot Line

Build a connected line by feeding in points over time.

Sketch Rect

Draw a rectangle.

Sketch Circle

Draw a circle from center and diameter values.

Sketch Ellipse

Draw an ellipse from center, width, and height values.

Coordinate Helpers

Sketch Get Mouse Position

Read mouse coordinates in sketch space.

Sketch Get Transform Position

Project a world-space Transform into sketch coordinates.

Notes

  • Sketch uses direct canvas drawing, so it is great for quick visualizations, interactive experiments, and translating Processing tutorials into FSMs.
  • The current version focuses on drawing directly to the canvas. Transform-style sketch commands such as translate, rotate, push, and pop are planned for future versions.
  • Sample scenes currently include GaussianDots, MouseCircles, MouseLines, PendulumPlot, PerlinNoisePlot, and RandomWalker.