Author Topic: UISprite  (Read 51664 times)

roid100

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: UISprite
« Reply #15 on: July 07, 2014, 09:50:21 PM »
I have one qeustion about Filled sprite.
I would like to use it for arc shape gauge.
When I use "Radial180" for arc shape gauge, deleting shape is not cool. Because it's center is the middle bottom of the image.
When I use "Radial360", it is not cool also. In this case, the center is the middle of the image.
I use the arc type gauge, the center should be the edge of the image. (sometimes it sould be the outside of image)
I wonder if I can customise the center of the fill sprite.
Thank you.
« Last Edit: July 07, 2014, 10:07:15 PM by roid100 »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: UISprite
« Reply #16 on: July 08, 2014, 01:23:18 PM »
You would have to create a custom widget for something like that. Override the OnFill function and pass your own vertices.

vikti

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: UISprite
« Reply #17 on: August 26, 2014, 01:44:57 PM »
What is the attributes for the height/width (in widget sub menu) ?
I can't get my eyes on it...

Is it get and set ?
« Last Edit: August 26, 2014, 01:52:02 PM by vikti »

vikti

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: UISprite
« Reply #18 on: August 26, 2014, 01:56:33 PM »
Arf...

-> UISprite.width inherited from UIWidget

Need a rest...

superbigface

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Re: UISprite
« Reply #19 on: August 28, 2014, 10:11:24 PM »
How can I create a two-sided sprite,just like cards in HearthStone ? Then I can see the front side and the back side when I rotate it.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: UISprite
« Reply #20 on: August 30, 2014, 09:31:11 AM »
Don't use a Unlit/Transparent Colored shader. Use a one-sided shader, and use two sprites. One for front, another for back.

YukioT

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: UISprite
« Reply #21 on: October 21, 2014, 07:29:27 AM »
Hello, I have vertical rope sprite that I need to tile vertically, and scale it when changing its width. Is there a built-in way for this or should I extend UISprites?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: UISprite
« Reply #22 on: October 22, 2014, 05:54:37 AM »
NGUI will either scale or tile, not both. You will need to code your own widget for something like that.

blulightjr

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Re: UISprite
« Reply #23 on: October 22, 2014, 05:37:24 PM »
I just recently updated Unity to 4.5.5 and NGUI to 3.7.4 and I can't seem to find where I can edit the properties of a sliced sprite anymore. It seems to have moved. Can anyone tell me where I can do that?

YukioT

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: UISprite
« Reply #24 on: October 23, 2014, 07:10:39 AM »
Ok thanks, will do.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: UISprite
« Reply #25 on: October 23, 2014, 03:47:58 PM »
I just recently updated Unity to 4.5.5 and NGUI to 3.7.4 and I can't seem to find where I can edit the properties of a sliced sprite anymore. It seems to have moved. Can anyone tell me where I can do that?
Same place they've always been. Select the atlas, choose the sprite, all the options are there.

If you are asking about UISlicedSprite -- a very, very old legacy script, then you need to run the Upgrade Tools and convert all of them to UISprite.

superbigface

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Re: UISprite
« Reply #26 on: November 12, 2014, 10:40:16 PM »
Hello,I had a question.I got a picture which looks like a parallelogram.
 ____________________
/___________________/

I use Type.Filled and FillDirection.Horizontal.But when I drag the fillAmount ,I get a picture:
 __________                 __________
/__________|     not    /_________/

if (mFillDirection == FillDirection.Horizontal)
{
   float fill = (u.z - u.x) * mFillAmount;

   if (mInvert)
   {
      v.x = v.z - (v.z - v.x) * mFillAmount;
      u.x = u.z - fill;
   }
   else
   {
      v.z = v.x + (v.z - v.x) * mFillAmount;               (What should I do)?
      u.z = u.x + fill;
   }
}

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: UISprite
« Reply #27 on: November 14, 2014, 05:09:48 AM »
If you want it to be tilted like that, you should create a custom widget type and feed your own vertices in its OnFill function. Or just keep it simple and make it a sliced sprite with the left and right side being a part of its border.

zs_3718

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: UISprite
« Reply #28 on: November 21, 2014, 03:55:15 AM »
Where is FillDirection.HorizontalMid?I can't find it.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: UISprite
« Reply #29 on: November 21, 2014, 09:16:23 PM »
There is no such thing as HorizontalMid.