We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi all, [spoiler: newbie alert],
I create a checkbox cb using createCheckbox with a label argument. Then I try to position my checkbox+label using cb.position(x,y) but somewhat to my surprise only the actual checkbox changes place, the label on the other hand remains on its original position. What is the best way to reposition the label as well?
var cb;
function setup() {
cb = createCheckbox('enabled', false);
}
function draw() {
cb.position(400, 400);
}
Thanks! (I'm using p5.js v0.4.23 March 04, 2016 and p5.dom.js v0.2.9 March 3, 2016)
Answers
https://forum.Processing.org/two/discussion/15473/readme-how-to-format-code-and-text
If I paste your code somewhere in p5.js' site, for example here:
http://p5js.org/reference/#/p5/smooth
It works as intended. That is, the label accompanies wherever the checkbox is position(). 8-|
Thanks, I see now that the p5js.org site uses a later version of p5.js. With that version it works for me too!
Also thanks for the reference to the code formatting documentation. I have updated my question for future readers.