Author Topic: Powerpoint animation re-sizable slider button.  (Read 3120 times)

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
Powerpoint animation re-sizable slider button.
« on: March 09, 2014, 09:45:55 AM »
Hi ArenMook,

I would like to know how to create a Power Point animation re-sizable slider button. 

In particular, which NGUI components or classes would be the best to use to start with.  Here is a video of the re-sizable slider button in action.

https://dl.dropboxusercontent.com/u/48378123/PowerPointAnimControls.mp4

Any suggestions is greatly appreciate it. 

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Powerpoint animation re-sizable slider button.
« Reply #1 on: March 09, 2014, 09:58:46 AM »
The video doesn't work for me.

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
Re: Powerpoint animation re-sizable slider button.
« Reply #2 on: March 09, 2014, 10:52:45 AM »
I think DropBox was having some problems.  I just checked it now and it seems to be working.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Powerpoint animation re-sizable slider button.
« Reply #3 on: March 10, 2014, 07:23:08 PM »
I would suggest having a look at UIDragResize script and how it's used in the chat window to make it possible to resize the window. In your case you'd make it resize the left or right side instead of bottom-right like it is in the chat window.

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
Re: Powerpoint animation re-sizable slider button.
« Reply #4 on: March 11, 2014, 07:38:46 AM »
Great idea,  Things are progressing nicely.

One thing I would like to know is how to best limit the drag resizing limit.  For example, in this video, I would like to limit the dragging so that it stops at the left limit of the slider.  The middle thumb belongs to the original slider and it works great.  I tried checking the limit by using if thumbLeft dragging < 0, but it's not working. 

https://dl.dropboxusercontent.com/u/48378123/DragResizeLimit.mp4

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
Re: Powerpoint animation re-sizable slider button.
« Reply #5 on: March 11, 2014, 07:46:36 AM »
Forgot to ask about the Right Limit. 

I'm using a Simple slider and added left and right thumb buttons as children of the original thumb button. 
It seems that if the thumb button is resized the slider doesn't seem to know about this new size. 

https://dl.dropboxusercontent.com/u/48378123/RightLimit.mp4


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Powerpoint animation re-sizable slider button.
« Reply #6 on: March 11, 2014, 04:26:26 PM »
UIDragResize has both min and max values you can set.

Don't use a slider. A slider isn't meant to work with foreground that resizes dynamically. Create two sprites -- one for the background and another for the foreground, and do your own logic for determining the "value" and limiting the movement.

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
Re: Powerpoint animation re-sizable slider button.
« Reply #7 on: March 12, 2014, 12:15:08 AM »
Ok, no slider,

Can you recommend some solid code that does the limiting reliably when dragging.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Powerpoint animation re-sizable slider button.
« Reply #8 on: March 12, 2014, 09:47:45 PM »
Code that does the limiting? It's up to you to set the min/max values on the UIDragResize component. As long as you set them, the dragging will be limited automatically.