Author Topic: Stretch Texture in runtime  (Read 3456 times)

basil_11

  • Guest
Stretch Texture in runtime
« on: January 04, 2013, 09:37:55 AM »
hi,
  can anyone help me in my problem with rescaling texture :)

 I want to rescale the texture by Adjusting the height without affecting the "other height on top" -> meaning:


Original scale:
      A
+++++++ <-- "other height" or A
+           +
+           +
+++++++ <-- i want to reScale my square texture/Image but only the "B" is stretching downwards
     B


final output is:
     A
+++++++ <--  did not move
+           +
+           +
+           + <-- point C
+           +
+           +
+++++++ <-- this one moved from "point C" as shown above to the current position
     B

Cripple

  • TNP Alpha
  • Full Member
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 117
    • View Profile
Re: Stretch Texture in runtime
« Reply #1 on: January 04, 2013, 11:49:30 AM »
Hi,

Set the Pivot point of your sprite to Top, then move your sprite where you want. Resize the sprite by modifiying the Y value of the Scale of its transform.

Regards.
Graphicstream Dev.

basil_11

  • Guest
Re: Stretch Texture in runtime
« Reply #2 on: January 06, 2013, 08:26:45 PM »
Hi Cripple,
   
   Thanks for the Answer, I appreciate it

   Can you give me some script sample for it if you have, thanks! :)

   I am just newbie in NGUI UNITY3D
   
   Thanks a lot master :) Regards