9
« on: November 26, 2013, 06:30:43 PM »
I've encountered some strange behaviour in the UIPanel. Whenever I create two panels and add widgets to both, the widgets that are added to the second panel are rendered at the wrong position. This happens either the moment I create them, or after panels alpha is set to 0 and then back to 1.
To reproduce this bug:
1. Create a 2D UI from the NGUI menu.
2. Rename Panel to Panel1
2. Duplicate Panel1 and rename it to Panel2
3. Move Panel1 100px to the left
3. Move Panel2 100px to the right
4. Drag a Wooden -> Control - Colored Button into the Panel1 (the button is added and rendered as expected)
5. Drag a Wooden -> Control - Colored Button into the Panel2. (button gizmo and collision box is added to the right position, but the actual button is rendered at the position of the button in Panel1)
Changing the Panel2 order, or disabling and re-enabling the panel, or running the game seems to fix it. But if you change the panels alpha to 0 and then back to 1, it gets broken again. The gizmo is drawn at the right position, while the button is rendered at the position of button in Panel1 (or the center of the screen).