Welcome,
Guest
. Please
login
or
register
.
April 24, 2026, 11:45:03 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Unparented sprite still clipped by panel
« previous
next »
Print
Pages: [
1
]
Author
Topic: Unparented sprite still clipped by panel (Read 3484 times)
tango209
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 3
Unparented sprite still clipped by panel
«
on:
June 11, 2013, 01:13:47 AM »
How do I unparent a sprite from its clipping panel so it isn't hidden when dragged outside of the panel? I tried setting the transform panel to null, but that doesn't seem to help.
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Unparented sprite still clipped by panel
«
Reply #1 on:
June 11, 2013, 04:01:18 PM »
Exactly how Drag & Drop example does it.
Logged
tango209
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 3
Re: Unparented sprite still clipped by panel
«
Reply #2 on:
June 11, 2013, 04:56:34 PM »
I'll look into it some more, but the example did not show the sprite as it was dragged.
Logged
Nicki
Global Moderator
Hero Member
Thank You
-Given: 33
-Receive: 141
Posts: 1,768
Re: Unparented sprite still clipped by panel
«
Reply #3 on:
June 11, 2013, 05:27:09 PM »
You need to mark it as changed in the panel, I believe. The widget should change which UIPanel it's being drawn by. If it hasn't noticed this, then the old drawcall is still there and that gets clipped as normal.
Logged
tango209
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 3
Re: Unparented sprite still clipped by panel
«
Reply #4 on:
June 11, 2013, 08:13:12 PM »
Thanks for the steer Nicki. Changed the widget's transform parent to another UIPanel and called the following helper function and it works now.
private
void
ParentHasChanged
(
UIPanel panel
)
{
List
<
UIWidget
>
list
=
new
List
<
UIWidget
>
(
panel
.
widgets
.
buffer
)
;
foreach
(
UIWidget widget
in
list
)
{
if
(
widget
!=
null
)
{
widget
.
ParentHasChanged
(
)
;
}
}
}
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Unparented sprite still clipped by panel