Author Topic: Pivot and UISprite  (Read 1749 times)

Warka0OO

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 3
    • View Profile
Pivot and UISprite
« on: September 04, 2013, 10:47:20 AM »
Hi everyone,

I don't know how to ask my request but i try to re-scale my UISprite by using his pivot like left/right with new vectors.  :D

How can i achieve this re-scale? I saw something in UIWidgetInspector but i guess there something better than copy/paste code if this class.

Thx a lot :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Pivot and UISprite
« Reply #1 on: September 05, 2013, 05:15:10 AM »
I'm not sure what you're asking. Sprite's size is its transform.localScale.

OnlineCop

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 51
    • View Profile
Re: Pivot and UISprite
« Reply #2 on: September 05, 2013, 09:22:58 AM »
It sounds like Warka0OO wants to change the pivot of his UISprite, then rescale the object, which would leave the left/right edge where it was, but it would change its center point as it grows.

It would effectively mimic the functionality of UIWidgetInspector.AdjustPosAndScale(), but dynamically instead of inside the Unity Scene view.

That's just my guess, anyway.  :P