-
Notifications
You must be signed in to change notification settings - Fork 228
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
docs(types.ts): add rotate() example #843
base: master
Are you sure you want to change the base?
Conversation
src/types.ts
Outdated
* sprite("bean"), | ||
* pos(200,140), | ||
* anchor("center"), | ||
* rotate(-90), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be indentation.
src/types.ts
Outdated
* // bean WITH anchor: rotates bean based on sprite center | ||
* // bean WITHOUT anchor: rotates bean relative to local space |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel this explanation makes no sense, all objects have a default achor and it is topleft.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I noticed that without anchor("center"), it will rotate the sprite on a different origin, or in this case the default anchor top left, but if I wanted to rotate the sprite without changing it's position at all, I'd use anchor("center"). I will rewrite the explanation to be more clear about that.
src/types.ts
Outdated
* ```js | ||
* // bean WITH anchor: rotates bean based on sprite center | ||
* // bean WITHOUT anchor: rotates bean relative to local space | ||
* const rotateBean = add([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable should be rotatedBean or simply bean
- Changed variable name to "bean" - Added indents - Made comment description more clear
- Made "with" and "without" lowercase - Changed the description again
Updated again with those minor adjustments |
Added rotate() example