Welcome,
Guest
. Please
login
or
register
.
January 15, 2025, 07:05:55 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Bug when moving items from one UIGrid to a second UIGrid
« previous
next »
Print
Pages: [
1
]
Author
Topic: Bug when moving items from one UIGrid to a second UIGrid (Read 3603 times)
soofaloofa
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 27
Bug when moving items from one UIGrid to a second UIGrid
«
on:
April 19, 2012, 09:54:48 AM »
Hi,
Version: NGUI 2.0.3 b
I am moving an existing item from one UIGrid to another at runtime. The problem is that the Widgets do not seem to be updating correctly when I do the move. You can test this by creating two UIGrids and then dragging an item from one to another using the Hierarchy view. Press Reposition Now on both grids and the updated grids do not update (items are missing).
I have the same problem when moving an item to a grid programmatically with the following code:
private
void
MoveObjectToThisUIGrid
(
GameObject go
)
{
Transform t
=
go
.
transform
;
t
.
parent
=
transform
;
t
.
localPosition
=
Vector3
.
zero
;
t
.
localRotation
=
Quaternion
.
identity
;
t
.
localScale
=
Vector3
.
one
;
go
.
layer
=
gameObject
.
layer
;
mGrid
.
Reposition
(
)
;
// mGrid is a reference to the attached UIGrid Component
}
Logged
soofaloofa
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 27
Re: Bug when moving items from one UIGrid to a second UIGrid
«
Reply #1 on:
April 19, 2012, 10:51:31 AM »
Looking at this some more I've found that my object is still being clipped by the old UIPanels clipping area. Is there a way to force the clipping panel to be updated?
Thank you!
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Bug when moving items from one UIGrid to a second UIGrid
«
Reply #2 on:
April 19, 2012, 11:49:11 AM »
Have you tried setting 'repositionNow = true' instead of calling Reposition? Parenting may not update right away, I vaguely remember running into this long before NGUI.
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Bug when moving items from one UIGrid to a second UIGrid
«
Reply #3 on:
April 19, 2012, 11:50:42 AM »
As for clipping still affecting the widget? I'm not getting this. The drag & drop example does the same thing: it moves an item out of a clipped panel, and it doesn't get clipped.
Logged
soofaloofa
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 27
Re: Bug when moving items from one UIGrid to a second UIGrid
«
Reply #4 on:
April 19, 2012, 12:15:23 PM »
I've sent you an e-mail with a scene that reproduces the problem.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Bug when moving items from one UIGrid to a second UIGrid