Hi! I just started using the newest version of p5.js and p5.dom.js, and the mousePressed() method throws an error when a DOM button is clicked. Here is my code:
var button;
function setup(){
noCanvas();
button = createButton(" ");
button.addClass("button button-primary button-border-thick button-box");
button.mousePressed(logPress);
}
function draw(){
}
function logPress(){
console.log("Boing");
}
When the button is clicked, the console gives this error message:
Uncaught TypeError: Cannot read property ‘_setProperty’ of undefined
at g.Element. (p5.min.js:7)
(anonymous) @ p5.min.js:7
I was using version 0.7.1 of both p5.js and p5.dom.js, but when I switched p5 back to version 0.6.1, this worked perfectly. Has anyone else encountered this issue??
edit: Here is my index.html code as well
<!-- Buttons core css -->
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.1/p5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.1/addons/p5.dom.min.js"></script>
</head>
<style>
body {
background-color: #FFFF00
}
</style>
<body>
<script src="code.js"></script>
</body>
<link rel="stylesheet" href="css/buttons.css">
</html>