mirror of
https://github.com/KevinMidboe/cubewaves.git
synced 2025-10-29 01:20:18 +00:00
Removed buttons and use only the slider. Could remove button code and decremenet function.
This commit is contained in:
@@ -16,19 +16,8 @@ function setup() {
|
||||
}
|
||||
|
||||
function draw_ui() {
|
||||
let dec = createButton('Decrement');
|
||||
let inc = createButton('Increment');
|
||||
|
||||
let c_c = window.innerWidth / 2;
|
||||
let spacing = min(c_c * 0.4);
|
||||
|
||||
dec.position(c_c - (spacing + inc.width), 25);
|
||||
inc.position(c_c + spacing, 25);
|
||||
dec.mousePressed(() => { decrement(5) });
|
||||
inc.mousePressed(() => { decrement(-5) });
|
||||
|
||||
slider = createSlider(18, 200, w);
|
||||
slider.position(c_c - slider.width * 0.5, 25);
|
||||
slider.position(window.innerWidth / 2 - slider.width * 0.5, 25);
|
||||
}
|
||||
|
||||
function draw() {
|
||||
@@ -66,6 +55,3 @@ function draw() {
|
||||
angle -= 0.08;
|
||||
}
|
||||
|
||||
function decrement(val) {
|
||||
w += val;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user