Author Topic: UI Sprite VS UI2D Sprite scaling  (Read 4096 times)

DJVDJV

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 30
    • View Profile
UI Sprite VS UI2D Sprite scaling
« on: March 03, 2016, 03:42:10 PM »
Hellos,

- When I use UI2D Sprite on my UI component and I change size of vidget. Sprite scales nicely.

- When I use same sprite as UI Sprite and part of atlas and trying change size of vidget sprite scales but also gets "blurred".

How I can avoid this blur on atlas sprites?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI Sprite VS UI2D Sprite scaling
« Reply #1 on: March 06, 2016, 12:53:44 PM »
Change the texture import settings on the atlas' texture.

DJVDJV

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 30
    • View Profile
Re: UI Sprite VS UI2D Sprite scaling
« Reply #2 on: March 07, 2016, 01:38:32 PM »
Change the texture import settings on the atlas' texture.

Hello. it worked!

But now I got other glitch. (Look attachment).
With some 9-slice sprites etc engine now seems do glitch on sprites.
It seems draw lines incorrect on some resolution. Glitch seems different in different resolutions. Have you idea what might cause this?


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI Sprite VS UI2D Sprite scaling
« Reply #3 on: March 12, 2016, 07:40:57 AM »
You might want to double-check the sprite's settings and make sure you didn't forget to set its border. NGUI's sprites don't use the border of Unity's sprites. You need to select the NGUI's atlas, choose the desired sprite in inspector and edit its border there.

DJVDJV

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 30
    • View Profile
Re: UI Sprite VS UI2D Sprite scaling
« Reply #4 on: March 22, 2016, 07:53:42 AM »
You might want to double-check the sprite's settings and make sure you didn't forget to set its border. NGUI's sprites don't use the border of Unity's sprites. You need to select the NGUI's atlas, choose the desired sprite in inspector and edit its border there.

Yep, I use "9-slice" button and border is set. That glitch comes only if "point" is set as "filter mode" for sprite. Filter mode "bilinear" or "trilinear" never does this. But My UI looks blurry with em.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI Sprite VS UI2D Sprite scaling
« Reply #5 on: March 24, 2016, 02:59:44 AM »
If your UI is pixel-perfect (1 pixel on screen = 1 pixel in your atlas) then there is no visible difference between filtering modes. If your UI is scaled, or your game window is shrunk, or anything else that causes your UI's pixels to not line up then yes, you may run into issues using point filtering.

DJVDJV

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 30
    • View Profile
Re: UI Sprite VS UI2D Sprite scaling
« Reply #6 on: March 24, 2016, 03:59:42 PM »
If your UI is pixel-perfect (1 pixel on screen = 1 pixel in your atlas)

How I get sure it is 1:1.. where I should check this?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI Sprite VS UI2D Sprite scaling
« Reply #7 on: March 27, 2016, 02:54:27 AM »
Just check your game window's size and your UIRoot settings. UIRoot set to "Flexible" scaling style combined with the game window that uses dimensions dividable by two means pixel-perfect UI, assuming you don't exceed the min/max height values set on UIRoot.