Author Topic: When do I use FixedSize vs PixelPerfect?  (Read 14848 times)

storm33229

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 44
    • View Profile
When do I use FixedSize vs PixelPerfect?
« on: June 20, 2013, 06:15:34 PM »
For UIRoot, when do I use FixedSize vs PixelPerfect? In what situations are one of these more useful than the other?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: When do I use FixedSize vs PixelPerfect?
« Reply #1 on: June 21, 2013, 05:36:08 AM »
PCs -- pixel perfect for crispness. Mobiles - fixed size for convenience. Combo setting that does both: Fixed Size on Mobiles.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: When do I use FixedSize vs PixelPerfect?
« Reply #2 on: June 21, 2013, 06:12:18 PM »
PixelPerfect:
Pixels on your sprites and labels will be 1:1 with the pixels on screen. This means that they will follow the dpi of the screen, and be smaller on a higher resolution screen / bigger on low res.

FixedSize
Will keep the same size respective to the manualHeight that is set in UIRoot. This creates "virtual pixel coordinates" which may or may not correspond with the screen pixels. It will keep the same relative size on all screens - something that's 1/2 screen size on low res, will also be 1/2 screen size on higher res.

Advanced use of Fixed size includes setting the manualHeight yourself, to get the result you want - maybe you want one setup for retina screens and one for non-retina screens - one way to do this is to set the manualHeight at double size and use higher resolution assets.

FixedSizeOnMobiles
The bastard child of the other two. Does pixelperfect on Editor and FixedSize on mobile - I think. I'm not entirely sure about that one as I've kept away from it because I fear dark magic.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: When do I use FixedSize vs PixelPerfect?
« Reply #3 on: June 22, 2013, 06:32:17 AM »
No dark magic there. That's the setting I used for Starlink. ;) If mobile, it will act like fixed size. If not, it will act like pixel perfect.

storm33229

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 44
    • View Profile
Re: When do I use FixedSize vs PixelPerfect?
« Reply #4 on: July 07, 2013, 11:24:51 PM »
I am having the problem that using PixelPerfect is causing sizing issues; whereas, using FixedSize is applying all of my scales correctly. If I have a UIStretch on a component using FixedSize all of the scales are maintained the same as when I created them. Using PixelPerfect does not maintain proper size/positions.

FixedSize has issues with artifacts, while PixelPerfect is crisp (I suppose this is expected due to up/down scaling).

I have attached screen shots to show the difference. The fixed size will take the whole UI and scale it appropriately, PixelPerfect... I am not sure what it is doing. It's the same exact setup, just a flag change.


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: When do I use FixedSize vs PixelPerfect?
« Reply #5 on: July 07, 2013, 11:33:35 PM »
The texture you're tiling should have a 1 pixel border all around.

storm33229

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 44
    • View Profile
Re: When do I use FixedSize vs PixelPerfect?
« Reply #6 on: July 07, 2013, 11:41:10 PM »
I have less issue with the texture, more issue with the actual scaling of the buttons and what not. The FixedSize is keeping everything scaled to how I set it up... PixelPerfect is scaling things differently.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: When do I use FixedSize vs PixelPerfect?
« Reply #7 on: July 08, 2013, 11:12:18 AM »
Your game window is set to 1024x768, and yet the window itself is much smaller than that. If you're going to choose pixel perfect, don't choose a resolution from the game window that can't fit into your game window.

storm33229

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 44
    • View Profile
Re: When do I use FixedSize vs PixelPerfect?
« Reply #8 on: July 08, 2013, 12:20:37 PM »
Your game window is set to 1024x768, and yet the window itself is much smaller than that. If you're going to choose pixel perfect, don't choose a resolution from the game window that can't fit into your game window.

Does it need to fit it exactly? Or will it scale up? I want to make sure my UI's look nice, layout the same, and are functional on all resolutions (within reason).

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: When do I use FixedSize vs PixelPerfect?
« Reply #9 on: July 08, 2013, 12:33:51 PM »
To work properly, yes it needs to fit. You can detach the game window and put it on the 2nd monitor if you have one.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: When do I use FixedSize vs PixelPerfect?
« Reply #10 on: July 08, 2013, 12:34:29 PM »
P.S. If you want to test different aspect ratios then do just that -- choose aspect ratios from the resolution dialog, not the actual fixed-size resolutions.

storm33229

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 44
    • View Profile
Re: When do I use FixedSize vs PixelPerfect?
« Reply #11 on: July 08, 2013, 01:13:14 PM »
So what is the appropriate pipeline for developing UIs in NGUI? View everything in an aspect ratio game window?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: When do I use FixedSize vs PixelPerfect?
« Reply #12 on: July 08, 2013, 11:03:10 PM »
Yeah, and if you want to change the "resolution" of the UI, do that on the UIRoot by switching it to FixedSize and giving it a manual size matching your target window's height (1080 for 1920x1080 for example).

storm33229

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 44
    • View Profile
Re: When do I use FixedSize vs PixelPerfect?
« Reply #13 on: July 09, 2013, 12:36:21 AM »
Yeah, and if you want to change the "resolution" of the UI, do that on the UIRoot by switching it to FixedSize and giving it a manual size matching your target window's height (1080 for 1920x1080 for example).

But as you said I'd use PixelPerfect for PC... if I do FixedSize I lose crispness... I don't know if what I want to do is change the resolution of the UI... I am talking about changing the resolution/size of the game window/screen.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: When do I use FixedSize vs PixelPerfect?
« Reply #14 on: July 09, 2013, 08:21:55 AM »
Your question was how to change the "resolution" of the UI, and manual size is how it's done. It doesn't mean you have to keep it at "manual" after you test the behaviour.