Author Topic: NGUI 3 - resize handles cannot constrain dimensions?  (Read 8198 times)

mindlube

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 46
    • View Profile
NGUI 3 - resize handles cannot constrain dimensions?
« on: September 23, 2013, 03:16:44 PM »
In most GUI / graphics editing apps, you can constrain a resize operation to operate on both dimensions so the sprite will have the same aspect ratio after the resize, as before. This really needs to be added to NGUI especially now that in NGUI 3 the sprite's own dimensions are used instead of the Sprite transform's dimensions. (Previously I would just use the Unity scale tool and drag the yellow center widget - which I guess I can still do... but it seems maybe no longer recommended to scale widgets that way) I tried Shift-drag, Option-drag, Ctrl-drag, all the usual suspects when dragging the handles on a sprite.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI 3 - resize handles cannot constrain dimensions?
« Reply #1 on: September 23, 2013, 04:08:02 PM »
Good idea, I'll add it in a future version.

paulygon

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: NGUI 3 - resize handles cannot constrain dimensions?
« Reply #2 on: October 08, 2013, 09:07:35 PM »
I'd like to know if I understand how the newest version of NGUI works. You've swapped out the use of a GameObject's scale in favor of a Widget's Dimensions, although scaling the GameObject still seems to work like before. So instead of using Unity's scale tool, I need to change scale by manually changing the Dimensions value in the inspector or using the new in-editor controls, neither of which seem to be able to maintain the aspect ratio of the values as I change them.

I'm sure there is a brilliant reason for these changes, by the way. I have learned to trust ArenMook for he is wise. It's entirely likely I've overlooked new help material that covers this.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI 3 - resize handles cannot constrain dimensions?
« Reply #3 on: October 09, 2013, 08:40:09 AM »
This post is from two weeks ago. I haven't gotten around to adding a way to maintain the aspect ratio of a sprite while resizing it. I did say, "future version", not "next version" :P

paulygon

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: NGUI 3 - resize handles cannot constrain dimensions?
« Reply #4 on: October 10, 2013, 07:09:25 PM »
I found the new tutorial movies (right after I found my brain). I get it now, you're the man.

If I may be so bold: Holding a modifier key or combination of keys, while performing the click-drag (be that in the inspector Dimensions value or the editor window controls). I'm not sure which modifier keys are unused by Unity. Also, no rush, you have bigger fish to fry, I'm sure.

JumpCore

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 18
    • View Profile
Re: NGUI 3 - resize handles cannot constrain dimensions?
« Reply #5 on: September 20, 2014, 03:31:30 PM »
Did this one ever make it in?

If so . . . I can't seem to find the right hotkey combo.

If not . . . +1 for a hotkey to constrain aspect ratio when resizing widgets.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI 3 - resize handles cannot constrain dimensions?
« Reply #6 on: September 21, 2014, 09:00:52 AM »
You can restrict aspect ratios by specifying an aspect ratio on the widget. Once chosen, it will always be maintained as you resize the widget. No need to hold any key.