-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial specs added
- Loading branch information
Showing
1 changed file
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,31 @@ | ||
# OPC | ||
OP Configurator 3000 | ||
# OpenProcessing Configurator 3000 | ||
This is a helper library that allows sketches on OpenProcessing to provide a UI to play with dynamic variables in their sketches. At the moment, UI components are only displayed if sketch is viewed on OpenProcessing, otherwise they are ignored and variables are set to 'defaultValue'. | ||
|
||
## Example | ||
Example below will display a range slider that you can change live while playing your sketch. | ||
``` | ||
//var radius = 10; //instead of defining a variable, use below | ||
OPC.slider('radius', 10, 0, 100, 1); | ||
function setup() { | ||
createCanvas(windowWidth, windowHeight); | ||
background(100); | ||
} | ||
function draw() { | ||
ellipse(mouseX, mouseY, radius, radius); | ||
} | ||
``` | ||
|
||
## Available Functions | ||
At the moment, only a few options are available, and more UI components are being added. Arguments in brackets are optional. | ||
|
||
### Slider | ||
Displays a range slider that user can change. | ||
``` | ||
OPC.slider(variableName, defaultValue, [min], [max], [step]); | ||
``` | ||
Default values: | ||
min: 0 | ||
max: 2*defaulValue | ||
step: defaultValue/10 |