Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hackhat opened this issue Aug 16, 2018 · 0 comments

Comments

@hackhat
Copy link

hackhat commented Aug 16, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant