Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: gummyb3ar on April 28, 2012, 01:11:39 AM

Title: Animated UISlider
Post by: gummyb3ar on April 28, 2012, 01:11:39 AM
Is there a way to use animated sprites with the UISlider? Also, is it possible to change how the end of the slider (that moves)? For instance, normally it makes a hard edge at the end, is there a way to change it to a softer edge? I was just wondering if its possible with the current implementation or if I'll have to make some of my own tweaks to the UISlider.

Thanks!
Title: Re: Animated UISlider
Post by: ArenMook on April 28, 2012, 01:13:20 AM
Just change the foreground to use a sprite, or a sliced sprite that doesn't have a border on the right-hand side and you will get the soft edge. Attach UISpriteAnimation to the slider to animate it (or just do it yourself by changing the sprite's spriteName.
Title: Re: Animated UISlider
Post by: gummyb3ar on April 28, 2012, 01:23:32 PM
Thanks for the reply. Just to be sure, I add the UISpriteAnimation to the Foreground and Background of the slider right? And one more question, is there currently anyway for NGUI to tween the 5 or so frames of the animation I make?
Title: Re: Animated UISlider
Post by: ArenMook on April 28, 2012, 09:47:31 PM
That's what UISpriteAnimation does. Give all 5 of your sprites a name that begins with the same syntax, for example "My Animation 0", "My Animation 1", etc. Then on the UISpriteAnimation specify "My Animation" as the prefix.
Title: Re: Animated UISlider
Post by: gummyb3ar on April 28, 2012, 11:22:32 PM
Hmm yeah that's what I've done, but it just cycles through the 5 frames. I guess I'm asking if there's a way to smooth out the motion between each frame?
Title: Re: Animated UISlider
Post by: ArenMook on April 28, 2012, 11:23:43 PM
Smooth it out? You mean fade one in while another is fading out? You'd have to code it yourself.