Author Topic: Stretch Sliced sprite beteeen widgets?  (Read 8536 times)

nkls

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 29
    • View Profile
Stretch Sliced sprite beteeen widgets?
« on: November 30, 2012, 10:10:58 AM »
I have one widget on the left of my screen, and one to the right.
Now I want a sliced sprite that is anchored and stretched between them.
I can use a UIStretch, but as soon as i change my UIRoot manual height it ruins my setup.

How do I solve this?
Thanks for support!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Stretch Sliced sprite beteeen widgets?
« Reply #1 on: November 30, 2012, 01:55:38 PM »
I think it's one of the issues fixed in the upcoming 2.2.7. Until then you can just write a script to do it.

nkls

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 29
    • View Profile
Re: Stretch Sliced sprite beteeen widgets?
« Reply #2 on: December 01, 2012, 10:42:18 AM »
Seems like a nice feature in an upcoming release. Ive actually tried to make a script myself, but I cant really get my head around it.
Atm I have 2 anchors, one anchored to the right edge of the widget placed on the left side off the screen, and the other one is anchored to the left edge of the sprite placed on the right side of the screen.
I can get the distance between those, but I cant figure out how to convert it to a correct localscale.x-value on my sliced sprice between them... Would appreciate some kind of input or help!

nkls

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 29
    • View Profile
Re: Stretch Sliced sprite beteeen widgets?
« Reply #3 on: December 03, 2012, 04:31:48 AM »
no hints at all?  :-\

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Stretch Sliced sprite beteeen widgets?
« Reply #4 on: December 03, 2012, 10:45:39 AM »
You know the Screen.width and the size offset -- say 50 pixels on each side. Your sliced sprite's size then becomes (Screen.width - 50 * 2).

nkls

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 29
    • View Profile
Re: Stretch Sliced sprite beteeen widgets?
« Reply #5 on: December 03, 2012, 12:41:43 PM »
sure, but if I change my UIroot that number (50 pixels) wont be correct anymore.. and I want a dynamic solution. See my problem? :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Stretch Sliced sprite beteeen widgets?
« Reply #6 on: December 04, 2012, 02:46:27 AM »
UIRoot has properties for that. PixelHeight or PixelSize or something I think? Check inside the class. I am waiting on a flight atm so can't check.

nkls

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 29
    • View Profile
Re: Stretch Sliced sprite beteeen widgets?
« Reply #7 on: December 04, 2012, 03:54:28 AM »
Hope you had a pleasant flight. I cant find any properties like that on UIRoot.. please get back to me when you are back!

nkls

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 29
    • View Profile
Re: Stretch Sliced sprite beteeen widgets?
« Reply #8 on: December 04, 2012, 06:43:43 AM »
Got it working by using "pixelSizeAdjustments". It wasnt documented in the help file, but found it in the script.
Thank you again for support.