From b1f92211ba98d3ba6fd14f5841f075a783d8c66a Mon Sep 17 00:00:00 2001 From: jmej Date: Wed, 26 Oct 2022 11:52:26 -0700 Subject: [PATCH 1/3] addButton function added --- libraries/p5.gui.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/p5.gui.js b/libraries/p5.gui.js index c758c2c..caeb9cb 100644 --- a/libraries/p5.gui.js +++ b/libraries/p5.gui.js @@ -136,6 +136,10 @@ qs.bindParams(object, params); }; + this.addButton = function(title, callback){ + qs.addButton(title, callback); + } + // noLoop() to call draw every time the gui changes when we are not looping this.noLoop = function() { qs.setGlobalChangeHandler(sketch._draw); From c8b6d718f24dbe6ec74322f975bdfa3d408181b2 Mon Sep 17 00:00:00 2001 From: jmej Date: Wed, 26 Oct 2022 11:57:58 -0700 Subject: [PATCH 2/3] adds setRangeValue and examples for setRangeValue and addButton --- README.md | 2 ++ libraries/p5.gui.js | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index a4deb84..dbe3486 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +this fork brings the addButton function from quickSettings and makes it available using this lib + # p5.gui ![screenshot of p5.gui](p5_gui_screenshot.png) diff --git a/libraries/p5.gui.js b/libraries/p5.gui.js index caeb9cb..673e682 100644 --- a/libraries/p5.gui.js +++ b/libraries/p5.gui.js @@ -140,6 +140,10 @@ qs.addButton(title, callback); } + this.setRangeValue = function(title, value) { + qs.setRangeValue(title, value); + }; + // noLoop() to call draw every time the gui changes when we are not looping this.noLoop = function() { qs.setGlobalChangeHandler(sketch._draw); From c38258b5e0ff9985fbd6ee683b5aff2bb5f9f66b Mon Sep 17 00:00:00 2001 From: jmej Date: Wed, 26 Oct 2022 12:03:41 -0700 Subject: [PATCH 3/3] changes setRangeValue to setValue for compatibility with quicksettings 3 --- libraries/p5.gui.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/p5.gui.js b/libraries/p5.gui.js index 673e682..bfe73b9 100644 --- a/libraries/p5.gui.js +++ b/libraries/p5.gui.js @@ -140,8 +140,8 @@ qs.addButton(title, callback); } - this.setRangeValue = function(title, value) { - qs.setRangeValue(title, value); + this.setValue = function(title, value) { + qs.setValue(title, value); }; // noLoop() to call draw every time the gui changes when we are not looping