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

keep aspect ratio option for spriterenderer #779

Open
Shadowblitz16 opened this issue Mar 22, 2020 · 2 comments
Open

keep aspect ratio option for spriterenderer #779

Shadowblitz16 opened this issue Mar 22, 2020 · 2 comments
Labels
Nice2Have Beneficial, but only very slightly so Usability Related to API and UI usability

Comments

@Shadowblitz16
Copy link

Summary

Add keep aspect ratio for sprite renderer
this would basically make sure the rect is always centered and and has the same size as the current texture frame.

Analysis

Pros

  • we would no longer need to make a script to adjust the rect on the sprite renderer.

Cons

  • none

Attachments

-Now
image

-What it could be
image

@SirePi SirePi added Nice2Have Beneficial, but only very slightly so Usability Related to API and UI usability labels Mar 22, 2020
@SirePi
Copy link
Member

SirePi commented Mar 22, 2020

Maybe it would make sense to add a method that sets a SpriteRenderer's Rect to the values obtained from the currently assigned Material/BatchInfo.

Something like a public void UseNativeSize(Alignment alignment) where Alignment is used to define the origin of the Rect.
Possibly add a button to call it from the editor as well, defaulting to Centered?

@Shadowblitz16
Copy link
Author

idk though I do think that it being centered and the aspect ratio mode should be separate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Nice2Have Beneficial, but only very slightly so Usability Related to API and UI usability
Development

No branches or pull requests

2 participants