Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: ENAY on June 21, 2013, 01:05:21 AM

Title: How do you stretch an UISlider?
Post by: ENAY on June 21, 2013, 01:05:21 AM
Hello, not quite sure why I am problems with this. Must be doing something wrong.

Ok, I have an energy bar using UISlider that has a length of about 200 pixels.

I want the energy to increase in length, for example to 300 pixels. But the UIValue "Value" slider from 0-1 is locked to 0-200.

I can modify the background image to stretch it to 300 but can't do it with the foreground image.
Title: Re: How do you stretch an UISlider?
Post by: ArenMook on June 21, 2013, 02:57:49 AM
It uses whatever value the sprite started with. Resize the foreground sprite at edit time. If you need to modify this value in play time, look at UISlider.fullSize.
Title: Re: How do you stretch an UISlider?
Post by: ENAY on June 21, 2013, 04:37:50 AM
Doh, that is pretty embarrassing.

I even looked through the source and saw

public Vector2 fullSize { get { return mSi.............

but since I was skimreading I didn't read any further into the line and see the "set" command. DOH! I think I need some sleep.

Cheers ArenMook. :)