Welcome,
Guest
. Please
login
or
register
.
May 30, 2026, 06:38:05 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
UIDraggablePanel Scrollbar isVisible
« previous
next »
Print
Pages: [
1
]
Author
Topic: UIDraggablePanel Scrollbar isVisible (Read 16798 times)
devomage
Sr. Member
Thank You
-Given: 7
-Receive: 67
Posts: 250
UIDraggablePanel Scrollbar isVisible
«
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?
Appreciate the best solution. Thanks!
public
UIDraggablePanel mypanel
;
Debug
.
Log
(
mypanel
.
verticalScrollBar
.
background
.
isVisible
)
;
Debug
.
Log
(
mypanel
.
verticalScrollBar
.
foreground
.
isVisible
)
;
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: UIDraggablePanel Scrollbar isVisible
«
Reply #1 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?
Logged
devomage
Sr. Member
Thank You
-Given: 7
-Receive: 67
Posts: 250
Re: UIDraggablePanel Scrollbar isVisible
«
Reply #2 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.
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: UIDraggablePanel Scrollbar isVisible
«
Reply #3 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.
Logged
devomage
Sr. Member
Thank You
-Given: 7
-Receive: 67
Posts: 250
Re: UIDraggablePanel Scrollbar isVisible
«
Reply #4 on:
June 11, 2013, 09:38:04 PM »
The barSize never returns a value of "1". See attached screenshot.
Debug
.
Log
(
"Update = "
+
mypanel
.
verticalScrollBar
.
barSize
)
;
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: UIDraggablePanel Scrollbar isVisible
«
Reply #5 on:
June 12, 2013, 03:50:06 AM »
Well in your case check for < 0.99 then
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
UIDraggablePanel Scrollbar isVisible