Skip to content
This repository was archived by the owner on Nov 12, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants