Author Topic: stretch - offset in pixel  (Read 1876 times)

laurentl

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 188
    • View Profile
    • McDROID
stretch - offset in pixel
« on: April 11, 2013, 02:05:33 AM »
stretch offset uses relative size in fraction of stretched size.
I want to stretch between two side buttons which are constant in pixel size so that relative size business doesn't work.
How do I do that ?

(it's like stretching between two anchors)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: stretch - offset in pixel
« Reply #1 on: April 11, 2013, 09:20:41 PM »
Write a custom script.

laurentl

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 188
    • View Profile
    • McDROID
Re: stretch - offset in pixel
« Reply #2 on: April 12, 2013, 01:07:16 AM »
Aren you smartass  ;D

I want details.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: stretch - offset in pixel
« Reply #3 on: April 12, 2013, 06:40:28 AM »
No, really :P

UIStretch won't work for what you are trying to do. You need to write a custom script that will calculate the distance between A and B, then position the object in the middle and set the scale to be that value (assuming central pivot).