Pixels per unit with UI

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
rauljl1
Posts: 55
Joined: Fri Apr 15, 2022 7:40 pm

Pixels per unit with UI

Post by rauljl1 »

Hi, Tony.

I'd like to use a sprite sliced on my UI response button.

But, when I put the sprite, the image looks thinner (wrong image). Every canvas in my game have Pixels per Unit on 1.

If i put Pixels per Unit at 6 looks good (pixel perfect image), but I don't like that way.

How to keep the pixel size?
Attachments
wrong.png
wrong.png (195.57 KiB) Viewed 175 times
pixelPerfect.png
pixelPerfect.png (273.57 KiB) Viewed 175 times
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Pixels per unit with UI

Post by Tony Li »

Hi,

Did you 9-slice your sprite? If so, make sure the button's image is set to Sliced.

If that doesn't address the issue, you may need to adjust the canvas's Canvas Scaler reference resolution to make it lower, or reduce the image's pixels per unit.
Post Reply