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

docs(types.ts): add rotate() example #843

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

SG-SWE073
Copy link
Contributor

Added rotate() example

@lajbel lajbel self-requested a review April 7, 2024 16:07
src/types.ts Outdated
Comment on lines 236 to 239
* sprite("bean"),
* pos(200,140),
* anchor("center"),
* rotate(-90),
Copy link
Contributor

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
Comment on lines 233 to 234
* // bean WITH anchor: rotates bean based on sprite center
* // bean WITHOUT anchor: rotates bean relative to local space
Copy link
Contributor

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.

Copy link
Contributor Author

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([
Copy link
Contributor

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
@SG-SWE073
Copy link
Contributor Author

Updated again with those minor adjustments

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

Successfully merging this pull request may close these issues.

2 participants