Skip to content
This repository was archived by the owner on Jul 11, 2025. It is now read-only.
This repository was archived by the owner on Jul 11, 2025. It is now read-only.

keep aspect ratio option for spriterenderer #779

Open

Description

@Shadowblitz16

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

Activity

  1. added
    Nice2HaveBeneficial, but only very slightly so
    UsabilityRelated to API and UI usability
    on Mar 22, 2020
  2. SirePi commented on Mar 22, 2020

    @SirePi
    Member

    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?

  3. Shadowblitz16 commented on Mar 22, 2020

    @Shadowblitz16
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Nice2HaveBeneficial, but only very slightly soUsabilityRelated to API and UI usability

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions