Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Selecting images from an array with a slider (ControlP5 + Processing3)
import controlP5.*;
ControlP5 cp5;
PImage[] images = new PImage[12];
int imageIndex = 0;
void setup(){
for(int i = 0; i < 12; i++){
images[i] = loadImage(i+".gif");
// instanciate the control p5 object
cp5 = new ControlP5(this);
// define the slider with the imageIndex variable bound
// set the range of the slider between 0 and the images array length -1
void draw(){
// display the image by doing sth like:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.