You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 11, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 11, 2025. It is now read-only.
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.
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?
Activity
SirePi commentedon 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 commentedon Mar 22, 2020
idk though I do think that it being centered and the aspect ratio mode should be separate.