Skip to content

Allow setting bake-to-PNG resolution for UI shapes (currently only works for sprite shapes) #10

Description

@all-iver

Easy fix is:

in Shapes2D/Scripts/Shapes.cs, change the lines at 1514,1515 from this:

    w = Mathf.Max(1, Mathf.RoundToInt(bounds.size.x / scaleFactor));
    h = Mathf.Max(1, Mathf.RoundToInt(bounds.size.y / scaleFactor));

to:

    w = Mathf.Max(1, Mathf.RoundToInt(bounds.size.x / scaleFactor * pixelsPerUnit / 100));
    h = Mathf.Max(1, Mathf.RoundToInt(bounds.size.y / scaleFactor * pixelsPerUnit / 100));

Then you can use the "Pixels Per Unit" setting in Shapes2D/Preferences, so for instance if you set it to 400 then your 64x64 Shape gets turned into a 256x256 PNG which should look nicer. You can also play around with the mipmap settings for the imported PNG, that might make a difference in how it ends up looking in-game.

Really, it might be nice to be able to set the PNG resolution you want each time you bake to sprite.

Activity

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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions