Author Topic: [SOLVED] UISlider seems to have this constant offset (v 2.6)  (Read 2358 times)

Thurinus

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 27
    • View Profile
[SOLVED] UISlider seems to have this constant offset (v 2.6)
« on: September 24, 2013, 07:19:26 PM »
Hi all,

We're still using NGUI 2.6.x, and are having trouble with creating a UISlider that would situate the thumb properly when clicked or dragged. Attached is a video captured on the Scene and Game windows to demonstrate the problem:
http://screencast.com/t/hwcLPsNj

This was a slider created straight from the Widget wizard, with the foreground removed. Notice how the thumb seems to be offset by half the width of the slider. I made sure that the collider was offset correctly to line up with the background. Anyone know what might be going on? Let me know if more information is needed to diagnose the problem, thanks!

Jay
« Last Edit: September 24, 2013, 08:00:23 PM by Thurinus »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UISlider seems to have this constant offset (v 2.6)
« Reply #1 on: September 24, 2013, 07:21:12 PM »
Check your pivot points. In 3.0 tutorial video I purposely made a mistake of moving the slider's foreground as well -- that affects it too. But you said you deleted the foreground? Not sure what for. If you want it to look the same, choose the same sprite for both foreground and background.

Thurinus

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 27
    • View Profile
Re: UISlider seems to have this constant offset (v 2.6)
« Reply #2 on: September 24, 2013, 07:42:02 PM »
I took a look at the video I think you're referring to (http://www.youtube.com/watch?v=OT0hTxjjkY4), and I think I've taken the necessary precautions.

I checked to make sure all the graphics that act as background and foreground are left-aligned, and the collider is offset accordingly. I also put the foreground back in as well. None of these fixed the issue. Is this an issue with older versions? We're not using v3 yet.

Thanks!

Thurinus

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 27
    • View Profile
Re: UISlider seems to have this constant offset (v 2.6)
« Reply #3 on: September 24, 2013, 07:59:44 PM »
I solved this by copying a later version of UISlider into the one that's currently embedded with our project. I reckon this might've simply been a bug from an earlier build of NGUI, judging by the diff.

Anyway thanks for the swift reply :)