Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
initial specs added
  • Loading branch information
msawired authored Aug 4, 2021
1 parent bda643d commit d165f82
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions README.md
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

0 comments on commit d165f82

Please sign in to comment.