-
Notifications
You must be signed in to change notification settings - Fork 503
Add RotationDirection to SpriteComponent #6091
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
Add RotationDirection to SpriteComponent #6091
Conversation
I'm a bit confused, could you explain what this allows you to do |
when a sprite is rotated by changing the Rotation value it will also rotate the directional sprite in the opposite direction so it looks like it always faces the same direction even when upside down or whatever |
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.
Would DirOffset
not be sufficient for this? With this system you still can't have a rotation and a direction rotation if they don't match.
Robust.Client/GameObjects/Components/Renderable/SpriteComponent.cs
Outdated
Show resolved
Hide resolved
Robust.Client/GameObjects/EntitySystems/SpriteSystem.Setters.cs
Outdated
Show resolved
Hide resolved
i'm not entirely sure i know what this means |
What if I want to apply RotationDirection only 90 degrees, but have the entire sprite rotated 180 degrees? |
oh okay one sec |
float |
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 specifically mentioned DirOffset
as it seemed like the best solution to me. In what scenario would a float parameter make sense here?
well if you set it to 1/2 and rotate the sprite 180 degrees it'll only rotate the direction 90 degrees |
Doing it by fractions like this sounds extremely impractical, when the obvious use case is single step offsets. |
... |
When enabled, the sprite of anything that possesses both a rotation and an RSI with directions will have the direction rotated with the sprite