Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: NormalUser on July 12, 2012, 05:23:50 PM

Title: Bug in UISlider?
Post by: NormalUser on July 12, 2012, 05:23:50 PM
Below, if mFGFilled is not null, but the fillDirection doesn't match the direction of the UIFilledSprite, the thumb won't move. I think that else if should just be an else condition; or there should be an else that fires off a warning/error. Took me a while to find out why the thumb sprite wasn't moving around when changing the sliderValue from the inspector.
if (mFGFilled != null)
                {
                    if (mFGFilled.fillDirection == UIFilledSprite.FillDirection.Horizontal)
                    {
                        pos.x = mFGFilled.invert ? fullSize.x - scale.x : scale.x;
                    }
                    else if (mFGFilled.fillDirection == UIFilledSprite.FillDirection.Vertical)
                    {
                        pos.y = mFGFilled.invert ? fullSize.y - scale.y : scale.y;
                    }
                }

Title: Re: Bug in UISlider?
Post by: ArenMook on July 12, 2012, 07:28:10 PM
Aha, this code was from before I added other methods. Thanks, I will fix it.
Title: Re: Bug in UISlider?
Post by: moonface on July 16, 2012, 06:25:02 AM
Hi,

I've just installed the latest version of NGUI and have the same problem.

The thumb doesn't move although it highlights when moused.

Is a fix coming soon?

Thanks
Title: Re: Bug in UISlider?
Post by: ArenMook on July 16, 2012, 11:24:39 AM
Change
  1. else if (mFGFilled.fillDirection == UIFilledSprite.FillDirection.Vertical)
to just:
  1. else
In general though, the thumb movement is only supported with horizontal or vertical filled sprites. Radially filled sprites shouldn't have a thumb.
Title: Re: Bug in UISlider?
Post by: moonface on July 17, 2012, 03:47:04 AM
Hi,

The direction of the sprite was set to radial fill 360 as a default (which I was unaware of) causing this issue for me.

Perhaps when a slider is added it should default to horizontal?

Anyway, it is sorted for me.

Thanks