Author Topic: Resize keeping aspect ratio with handles  (Read 3641 times)

vallcrist

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 49
    • View Profile
Resize keeping aspect ratio with handles
« on: December 17, 2013, 09:24:14 PM »
Hello there.

I believe this might be an easy thing, but i've been searching and trying lots of modifier key combinations, and i can't find a way to resize a sprite keeping the aspect ratio, like i want it bigger or smaller but without deforming it.

I know this is not the best way, usually you want the sprites to be the perfect size in order to stay crisp and occupy the smallest space in the atlas, but sometimes we have to try various sizes in order to decide which is the final..

So, any tips?

chirhotec

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: Resize keeping aspect ratio with handles
« Reply #1 on: December 17, 2013, 09:49:35 PM »
Prior to 3.0.7 you use UIStretch to accomplish this. Although they're deprecated, there should be some older videos floating around out there that describe how to set these up, and you can check out their pages in the documentation subforum.

(does anyone have any reasons these shouldn't be used if you need to keep the aspect ratio? I know they shouldn't be used with the new anchoring system)

In 3.0.7 the anchoring system was replaced, which replaced UIAnchor and UIStretch. Unfortunately, the corresponding features that kept aspect ratio in tact were not (yet) implemented. See http://www.tasharen.com/forum/index.php?topic=7092.msg33495#msg33495

vallcrist

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 49
    • View Profile
Re: Resize keeping aspect ratio with handles
« Reply #2 on: December 17, 2013, 10:28:56 PM »
Hey chir, thanks for the reply.

I'm afraid that's not what i need, tho.

I mean small resizes to adjust the size of an sprite, as if we used the Unity Scale tool and clicked in the white cube in the middle. This does work, but it's far from optimal since when i do this I modify the scale of the widget, which isn't a good thing, afaik.

chirhotec

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: Resize keeping aspect ratio with handles
« Reply #3 on: December 18, 2013, 12:01:00 AM »
Ah, now I get it. I don't have an answer, but I agree it would be a nice feature.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Resize keeping aspect ratio with handles
« Reply #4 on: December 18, 2013, 12:31:17 PM »
It's a planned feature. I just haven't gotten around to it, but will be adding it within the next ~3 weeks. I'm currently focusing on pimping out input fields, and it's going sloooow...

Nerg

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: Resize keeping aspect ratio with handles
« Reply #5 on: September 11, 2014, 02:59:52 PM »
Any news about this feature? I agree that this would be a pretty awesome addition to the handle system.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Resize keeping aspect ratio with handles
« Reply #6 on: September 12, 2014, 04:06:08 AM »
You can currently specify an aspect ratio on widgets, and if an aspect ratio is specified, it will be respected when you resize the widget.

Nerg

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: Resize keeping aspect ratio with handles
« Reply #7 on: September 14, 2014, 06:45:30 AM »
Ah yes, I see now! Just what I needed, thanks   8)