P5.js-web-editor: createButton() not working.

Created on 17 Sep 2018  Â·  4Comments  Â·  Source: processing/p5.js-web-editor

createButton() seems to be ‘undefined’

https://editor.p5js.org/slow_izzm/sketches/Hk0_VX6uX

Most helpful comment

I've noticed this as well. As a temporary workaround, you can go into the index.html file and change the p5.js library to point to 0.7.2:

<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.2/p5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.2/addons/p5.dom.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.2/addons/p5.sound.min.js"></script>

Also, here is a sketch you can "duplicate" with the change made:

https://editor.p5js.org/codingtrain/sketches/SyvvHLa_X

@catarak I suppose we should move to 0.7.2 as the default?

All 4 comments

This is a problem with the recent release of p5.js (v0.7.1), not the editor, although the editor recently updated to point to that recent version. It is staged to be fixed in the next version
https://github.com/processing/p5.js/issues/3141
Currently the .mousePressed() listener isn't working.
Can you use .mouseClicked() for your project?

I've noticed this as well. As a temporary workaround, you can go into the index.html file and change the p5.js library to point to 0.7.2:

<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.2/p5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.2/addons/p5.dom.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.2/addons/p5.sound.min.js"></script>

Also, here is a sketch you can "duplicate" with the change made:

https://editor.p5js.org/codingtrain/sketches/SyvvHLa_X

@catarak I suppose we should move to 0.7.2 as the default?

today i will update the default p5 version to 0.7.2. unfortunately i still have to do it manually—haven't figured out an easy way for it to not be manual!

yes, mouseClicked() works,
also updating index.html to 0.7.2 fixed createButton() issue.

thanks everyone.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

plxity picture plxity  Â·  3Comments

willingc picture willingc  Â·  5Comments

zeyaoli picture zeyaoli  Â·  4Comments

runemadsen picture runemadsen  Â·  5Comments

AltoRetrato picture AltoRetrato  Â·  4Comments