Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Chaosgod_Espér on November 30, 2015, 05:43:26 AM

Title: Slider Thumb Placement is wrong - How to fix it?
Post by: Chaosgod_Espér on November 30, 2015, 05:43:26 AM
Hi there..

I tried to create a Slider with this Sprites:
Background
(http://fs5.directupload.net/images/151130/ewft3c3v.png)
Foreground
(http://fs5.directupload.net/images/151130/j34sverx.png)
Thumb
(http://fs5.directupload.net/images/151130/lq6hkf5v.png)


I´m using the latest NGUI version, and created the Slider that way:
• create Empty child
• NGUI -> Attach -> Slider Script
• create the UISprites as children of the SliderObject
  (the Foreground and Background are sliced)
• All Widget privots are Center/Center
• The Thumb Sprite has a BoxCollider attached (with auto adjust size)
• Slider Directionis "Bottom To Top"

The Results:
(http://fs5.directupload.net/images/151130/gtqddll3.png)

What have i made wrong?
Title: Re: Slider Thumb Placement is wrong - How to fix it?
Post by: ArenMook on December 01, 2015, 07:27:20 AM
I can only suggest having a look at provided slider controls to see what differs from yours. Make sure you are using scales of (1, 1, 1).
Title: Re: Slider Thumb Placement is wrong - How to fix it?
Post by: Chaosgod_Espér on December 01, 2015, 09:55:16 AM
The same problem is in the Examples..
It seems like the Thumb is always placed in the center of the Foreground.. 


Isn´t there a way to create a slider or scrollbar, where the thumb is at the outer edge of the bar, instead of this worng placed thing?


Edit: ugly workaround:

• Slider Main (UISlider, Background Sprite, Foreground Sprite, Thumb)
• • Background Sprite
• • Foreground Sprite with alpha 0, offset of Y -248
• • Foreground visible Graphic, with Y offset of -232 and no affect to the slider - just to show the red inner
• • Thumb (with BoxCollider)

It´s a bit stupid to need a transparent graphic as Foreground, to adjust the Thumb position, and a visible Foreground, to show something ._.
Title: Re: Slider Thumb Placement is wrong - How to fix it?
Post by: ArenMook on December 09, 2015, 12:48:38 PM
The thumb is just a gameobject. It doesn't need to be a sprite. You can just have a game object there that has a sprite as a child, and adjust the sprite's position accordingly.