Author Topic: Resolution independent problem  (Read 15906 times)

gamedivisionuk

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 36
    • View Profile
Resolution independent problem
« on: October 09, 2016, 04:41:03 AM »
i can't find anything up to date which really explains how to set your UI for any screen size including text.
ive set UIRoot to constrain  1080 width 1920 height and im using anchors on my buttons set to Unified and setting the text to resize freely, firstly i get loads of issues when setting my anchors as far as, soon as i set the anchors they all stretch and i can't resize them, if i set the original size on my UILabel it just goes back to stretched,when loading bigger screen sizes the button and text dont get any bigger and looks tiny on ipad so im not really sure where to go from here
anyone have any ideas

thanks

gamedivisionuk

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 36
    • View Profile
Re: Resolution independent problem
« Reply #1 on: October 11, 2016, 09:24:41 AM »
i still haven't found any solution any ideas

 ;D

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Resolution independent problem
« Reply #2 on: October 11, 2016, 10:46:25 AM »
Constrained means your UI will always be the same size proportional to your screen, regardless of screen resolution. You won't get crisp text that way. Flexible style without limiting height will give you crisp UIs, and will let anchors function properly.

gamedivisionuk

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 36
    • View Profile
Re: Resolution independent problem
« Reply #3 on: November 04, 2016, 05:23:06 PM »
i just dont see how this works at all ive tried every variation, images dont resize at all using anchors is glitchy i mean i cant resize anything after adding anchors because the image either shrinks tiny or covers the whole screen and you can't change it back unless you remove the anchor

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Resolution independent problem
« Reply #4 on: November 05, 2016, 09:53:04 AM »
Nothing should be getting resized. Not sure why you are trying to resize anything. Scales should remain at (1, 1, 1), otherwise how can you get crisp anything? And anchors are meant to work with (1, 1, 1) scales as well -- certainly aren't meant to handle variable scales. The way Unity combines scales, there is no transform.scale like there is transform.position.

gamedivisionuk

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 36
    • View Profile
Re: Resolution independent problem
« Reply #5 on: November 05, 2016, 05:08:05 PM »
ok so here is the issue when adding an anchor to a sprite it just resizes its self when trying to resize back to original size it just gets bigger wont let me downsize at all check video
https://youtu.be/VcEcF5zjNfo

gamedivisionuk

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 36
    • View Profile
Re: Resolution independent problem
« Reply #6 on: November 07, 2016, 11:42:46 AM »
i guess ill switch to unity gui because i cant use ngui with the situation at the moment

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Resolution independent problem
« Reply #7 on: November 09, 2016, 12:24:47 PM »
To re-iterate on what I said. Transform scale must remain (1, 1, 1). Look at your scale in your own video: 6.21?

gamedivisionuk

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 36
    • View Profile
Re: Resolution independent problem
« Reply #8 on: November 09, 2016, 04:02:02 PM »
still does the same thing,i reset all the scales to 1,1,1 added an anchor and it resized the sprite all by itself so your theory didnt work any more ideas

To re-iterate on what I said. Transform scale must remain (1, 1, 1). Look at your scale in your own video: 6.21?

gamedivisionuk

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 36
    • View Profile
Re: Resolution independent problem
« Reply #9 on: November 12, 2016, 06:13:35 PM »
great plugin horrendous support one month later no further on  >:(

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Resolution independent problem
« Reply #10 on: November 14, 2016, 06:42:02 AM »
You're adding what anchor? Widgets have built-in anchoring, and it doesn't touch the transform scale. Nothing does. The anchoring changes the Size property of the widget and adjust the transform's position. Select the UIRoot, ALT+SHIFT+P -- this forcefully resets all scales to their default correct values of (1, 1, 1).

When working with NGUI, the same as Unity's UI, you need to be using the Rect transform too (T shortcut). If you're using W (move) and R (scale), then you're using the wrong tools.

gamedivisionuk

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 36
    • View Profile
Re: Resolution independent problem
« Reply #11 on: November 14, 2016, 03:38:34 PM »
yes im fully aware of the tools here is another video showing you the issue,when setting the anchor it resizes my images
https://youtu.be/fVt7QxJ7zo4



You're adding what anchor? Widgets have built-in anchoring, and it doesn't touch the transform scale. Nothing does. The anchoring changes the Size property of the widget and adjust the transform's position. Select the UIRoot, ALT+SHIFT+P -- this forcefully resets all scales to their default correct values of (1, 1, 1).

When working with NGUI, the same as Unity's UI, you need to be using the Rect transform too (T shortcut). If you're using W (move) and R (scale), then you're using the wrong tools.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Resolution independent problem
« Reply #12 on: November 15, 2016, 09:14:09 AM »
Oh, I see your issue. You're on a Mac using Unity 5.4. OSX version of the Unity editor has a bug in it where the screen size can't be determined unless the game view is actually visible. You need to simply have your game view actually visible, and it will work as expected.

gamedivisionuk

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 36
    • View Profile
Re: Resolution independent problem
« Reply #13 on: November 15, 2016, 03:37:00 PM »
i reduced my screen size when outputting the video but the game view was always open to the right of the video

Oh, I see your issue. You're on a Mac using Unity 5.4. OSX version of the Unity editor has a bug in it where the screen size can't be determined unless the game view is actually visible. You need to simply have your game view actually visible, and it will work as expected.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Resolution independent problem
« Reply #14 on: November 19, 2016, 06:54:49 AM »
Ok, then the only other reason why such oddities would happen can be due to having more than one camera drawing the UI layer. I suggest making a brand new scene, adding a sprite (ALT+SHIFT+S), anchoring it and seeing if that works correctly. Other than that I'm at a loss, because as far as I know everything works as expected (and I use NGUI daily here). I would need a repro case to have a look at.