Author Topic: Scroll bar problem size  (Read 8095 times)

nilton_felicio

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Scroll bar problem size
« on: March 26, 2013, 09:00:06 AM »
I'm using componete Scroll Bar with Background and Foreground with simple sprite type. I do not want sliced​​. I packed my sprites so as not to distort. The problem is that when the value reaches "0" or "1" distorts. I would not distort. How to solve? Photo attached. Thank you and sorry for my English.


Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Scroll bar problem size
« Reply #1 on: March 26, 2013, 11:49:30 AM »
You're using the Button as a foreground? It should be used as a thumb, then it won't be distorted. Look in the the example that comes with unity for how to; or make a new slider, just to see it.

I hope that helps.

nilton_felicio

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Re: Scroll bar problem size
« Reply #2 on: March 26, 2013, 12:58:45 PM »
Scroll Bar comprises Background and Foreground. With Slider thumb is. I'm not using Slider. And it just this distorted when it reaches "0" or "1". As he glides through the distortion does not happen, everything is perfect.

nilton_felicio

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Re: Scroll bar problem size
« Reply #3 on: March 26, 2013, 02:05:14 PM »
Problem solved. The background must have the same height as the forenground.

biggestgeek

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: Scroll bar problem size
« Reply #4 on: November 21, 2013, 03:58:19 AM »
Hi, I was searching in the forums and came across this thread. I have the exact same problem as described above but can't seem to find a solution, even after changing the sizes. The dimensions of my scroller/forground would resize itself when the value of the scroll bar is 0 or 1.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Scroll bar problem size
« Reply #5 on: November 21, 2013, 04:14:20 AM »
1. Use a UIWidget for the foreground (since it's invisible).
2. Create a separate sprite for the thumb.
3. Attach a UIAnchor to the sprite from step 2, and make it use the foreground widget from step 1 as the container.

biggestgeek

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: Scroll bar problem size
« Reply #6 on: November 21, 2013, 04:38:14 AM »
Hi ArenMook,

Sorry for being a noob but it didnt quite work. What I did was use:
1.Add UIWidget Container to the foreground Game Object.
2.Create a separate sprite for the thumb.
3.Attached a UIAnchor script to the sprite which I just created and dragged the Foreground GO into the Container portion of the script.

Am I doing it correctly? What I got was i could not even move the scroll bar or interact with it.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Scroll bar problem size
« Reply #7 on: November 21, 2013, 05:13:04 AM »
No, not widget container. UIWidget.

biggestgeek

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: Scroll bar problem size
« Reply #8 on: November 21, 2013, 06:04:32 AM »
I can't seem to add it. Tried the short cut of ALT+SHIFT+W but nothing happens.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Scroll bar problem size
« Reply #9 on: November 21, 2013, 02:18:37 PM »
With what version of NGUI?

biggestgeek

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: Scroll bar problem size
« Reply #10 on: November 21, 2013, 08:36:32 PM »
I'm using version 3.0.2 I'm assuming thats the latest version?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Scroll bar problem size
« Reply #11 on: November 22, 2013, 03:22:28 AM »
Nope. 3.0.5 / 3.0.6 depending on your access level.

http://www.tasharen.com/forum/index.php?topic=11