-
Notifications
You must be signed in to change notification settings - Fork 228
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