phaser-ce-examples
phaser-ce-examples copied to clipboard
http://labs.phaser.io/edit.html?src=src/paths/curves/cubic%20bezier%20bounds.js
Confusing API and example
http://labs.phaser.io/edit.html?src=src/paths/curves/cubic%20bezier%20bounds.js
// Draw t
curve.getPoint(path.t, path.vec);
graphics.fillStyle(0xffff00, 1);
graphics.fillCircle(path.vec.x, path.vec.y, 16);
Took me a while to understand that getPoint actually changes the path. Why you don't just do:
path.vec = curve.getPoint(path.t);
is so strange for a get function to change your vars just like that