phaser-ce-examples icon indicating copy to clipboard operation
phaser-ce-examples copied to clipboard

http://labs.phaser.io/edit.html?src=src/paths/curves/cubic%20bezier%20bounds.js

Open hackhat opened this issue 7 years ago • 0 comments

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

hackhat avatar Aug 16 '18 06:08 hackhat