Author Topic: NGUI Pixel Perfect for 1x, 2x, 4s Resolutions  (Read 2592 times)

Sam55555

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
NGUI Pixel Perfect for 1x, 2x, 4s Resolutions
« on: July 16, 2014, 12:32:47 AM »
Hi,
i have GUI that used 1x, 2x and 4x Widgets sizes. Now i anchor widget to themselves(left->right, top->down, other side anchors used to placement) and change absolute anchor size to 1x, 2x or 4x and setup one texture from sprites for this pixel perfect use (anchor absolute = sprite size). But i would like to change size with dimensions and setup anchors new(with same settings), widget should change size relatively to pivot, but position must be same. What is the best approach to use this 1x, 2x, 4x system with anchors.

The other question, some anchors have absolute distance. That must be "Value" on 2x and "Value x 1/2" on 1x and "Value x 2" on 4x. What is the best approach to change this distance.

Thank you.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI Pixel Perfect for 1x, 2x, 4s Resolutions
« Reply #1 on: July 17, 2014, 01:45:22 AM »
If you're working with 1x, 2x, and 4x resolutions (SD, HD, UHD), then you should leave the UIRoot as Fixed Size, and only change the pixel density on the atlases, implying that widget positions would not change in this case -- meaning neither would anchors.

Sam55555

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: NGUI Pixel Perfect for 1x, 2x, 4s Resolutions
« Reply #2 on: July 17, 2014, 04:10:48 AM »
Sorry, but fixed size not the options. What i need it pixel perfect with absolute anchors. We use only Unity Sprites for GUI. What is best approach to manage this?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI Pixel Perfect for 1x, 2x, 4s Resolutions
« Reply #3 on: July 18, 2014, 04:30:50 AM »
There is no feature in NGUI that would scale anchors by 2x, 4x, etc. Anchors have 2 values: relative (percentage-based), and absolute (pixel offset). There is nothing that would adjust the two based on the screen size.