Learn creative coding writing simple programs

139. Tweak values while a program runs

(Jump to 7:19 to see Tweak in action)

Tweak is a Processing mode that allows you to change any numbers in your program while the program runs. Without the Tweak mode you would have to stop your program, change a value, start your program again and observe the changes. This new mode helps you fine tune your program in real time, while it runs.

The effect of each number in a program is easy to understand when it can be manipulated interactively and the result observed without delay. Try writing this program and tweaking each value:

void setup() {} void draw() { ellipse(50, 50, 50, 50); }

Try replacing ellipse() with line() and other drawing functions.

Note: the setup() function must exist for Tweak to work.

Tags: tweak, variables, interactive

Code editor

You can make changes to the code below. Then
Questions and comments are welcome! :) But please try to stay close to the topic of this episode. Use the Processing forums for help with your Processing projects (or hire me for help ;-)