So I’m toying around with KineticJS and I’m having some problems with a button I’m making. All I want it to do is reset the positions of my objects when I click it.
I’ve created the button, set up the onclick handler to point to my function that I’ve created (and included in the HTML, along with my CSS), and I’ve gone through the KineticJS documentation for changing the position of it’s objects, and have tried the following options:
object.setX(200);
object.setY(50);
object.setPosition(200,50);
All with no luck. I’ve attached a screenshot with all my relevant code (This is my first time playing as a web dev, please don’t tear me up too much). The rest of the code in the middle column is just end tags for body/html/etc.
NOTE: I know the values are not what they were originally. I just threw in arbitrary numbers (still within the bounds of my canvas) to see if they’d change at all.
Thank you for any help!
Fullsize: https://i.stack.imgur.com/hD8vy.png

You need to add
layer.draw();at the end of resetXY function