xxxxxxxxxx
16
var myslider; // setting up a variable for the object
var anotheryguy; // creating another slider because why not!
function setup() {
createCanvas(400, 400);
myslider = createSlider(0, 255, 10); // creating a new instance of the slider object in the variable myslider
anotherguy = createSlider(0, 255, 10);
// the parameters for slider are (min value, max value, starting value)
}
function draw() {
background(myslider.value(), 100, 100);
fill(100, anotherguy.value(), 100);
ellipse(100, 100, 60, 60);
console.log("the value of my first slider: " + myslider.value() + ", the value of my second slider: " + anotherguy.value());
}