Support => NGUI 3 Support => Topic started by: devomage on June 10, 2013, 11:19:29 PM
Title: UIDraggablePanel Scrollbar isVisible
Post by: devomage on June 10, 2013, 11:19:29 PM
Where/when is the best place to detect changes in this property? Fails in both Awake/Start and takes a cycle or two in Update. Is there possibly an event to subscribe to that i'm overlooking?
Title: Re: UIDraggablePanel Scrollbar isVisible
Post by: ArenMook on June 10, 2013, 11:30:56 PM
UIWidget.isVisible simply tells you if the widget's alpha is above zero, and the scrollable panel tweens the alpha of the scroll bar to make it fade in -- which is likely why you are seeing a delay.
What are you trying to do?
Title: Re: UIDraggablePanel Scrollbar isVisible
Post by: devomage on June 10, 2013, 11:49:53 PM
The size of my highlight sprite and a couple buttons are conditional if the scrollbar is visible. I am using 2 different prefabs for the grid rows and disabling the 2 up/down scrollbar buttons.
Title: Re: UIDraggablePanel Scrollbar isVisible
Post by: ArenMook on June 11, 2013, 04:04:55 PM
Why not check UIScrollBar's barSize instead? It will be 1 if the window is able to fit everything, and non-1 if it can't.
Title: Re: UIDraggablePanel Scrollbar isVisible
Post by: devomage on June 11, 2013, 09:38:04 PM
The barSize never returns a value of "1". See attached screenshot.