📑 Creates a slider element.
Use the value property to get or set the slider's value.
value
Use the val function to get the slider's value as a number.
val
minimum value
maximum value
Optional
initial value
step size
await Canvas(200);let slider = createSlider(0, 1, 0.5, 0.1);slider.position(10, 10).size(180);q5.draw = function () { background(slider.val());}; Copy
await Canvas(200);let slider = createSlider(0, 1, 0.5, 0.1);slider.position(10, 10).size(180);q5.draw = function () { background(slider.val());};
📑 Creates a slider element.
Use the
valueproperty to get or set the slider's value.Use the
valfunction to get the slider's value as a number.