Reference for on_step
Specify callback for when the sketch ends execution. This is part of the reference section.
Arc
Buffer
Data
Dialog
Ellipse
Geo Utils
Image
Joystick (future)
Keyboard
Line
Mouse / Touchscreen
Pixel
Rectangle
Renderers
Shape
Sound (future)
Style
System
on_step
Text
Transform
Purpose
Register a callback for when the sketch redraws. This function should expect a single parameter which is the sketch redrawing.
Snippet
Register a callback for when the sketch takes a "step" and has an opportunity to redraw.
def callback(sketch_drawing): print('Drawing') sketch.on_step(callback)
Parameters
- callback: The function to invoke when the sketch stops execution.
Examples
Availability
Available for Sketch2DApp and Sketch2DWeb.