Author Topic: How To Make Slider that slides on a certain path???  (Read 2076 times)

abrk

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 3
    • View Profile
How To Make Slider that slides on a certain path???
« on: January 17, 2016, 06:09:52 AM »
Hi  :)
I need Some Help
I have a curved line.every point of this line has a number.
I need a slider that can move on this curved line and show the related number at every point.
(just like the horizontal or vertical slider,but i need it to slide on a curved path)
How can i do it in NGUI?
Please Help me
Sorry of my bad English
& Thanks a lot

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How To Make Slider that slides on a certain path???
« Reply #1 on: January 20, 2016, 08:22:29 AM »
You will need to create a custom widget for that with your own custom OnFill function.

abrk

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: How To Make Slider that slides on a certain path???
« Reply #2 on: January 20, 2016, 10:32:16 AM »
You will need to create a custom widget for that with your own custom OnFill function.
I don't know how to make custom widget or how to use OnFill function.
Would you please explain it for me?
Thanks in advance :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How To Make Slider that slides on a certain path???
« Reply #3 on: January 25, 2016, 10:00:46 PM »
Just have a look at how existing widgets are made. For example look at UITexture. It inherits from UIBasicSprite, overwriting its OnFill function which is what does the drawing. In UITexture's case it simply uses the Fill function inside Basic Sprite after figuring out the inner and outer rectangles of the texture (used for slicing). In its heart the OnFill function is simply about filling the geometry buffers. You can replace the whole thing with the UIBasicSprite's SimpleFill function for example -- it can't get any easier than that.