Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: ClockStone_Helmut on February 26, 2015, 12:25:55 PM

Title: Invisible sprites in 3.8.0 and earlier on mobile devices
Post by: ClockStone_Helmut on February 26, 2015, 12:25:55 PM
For an estimated 6 months now we are having problems with invisible sprites.
Likely the UIPanel does not refresh correctly

The problem most notably appears on slow devices that are prone to frame rate hiccups and might have low memory.
Examples would be the iPhone4 and the Nexus S.
On new and fast devices we hardly ever have the problem, if at all.

Things that we use in problematic cases might cause it individually (just a listing, no order implied)



Maybe 1. is a necessary condition for all the other cases, because we make extensive use of it, and it might be involved in all problematic cases.

The problem occurs randomly.
When it happens it makes a random selection of sprites invisible. Not always the same sprites, even in the same application execution.

* We also sometimes had invisible sprites inside the Editor that would become visible after manually disabling/enabling it.
* We also had problems with grid items not getting a layout, e.g. they would all remain in the same spot. (we only add objects directly to the hierarchy, and don't use any NGUI helper methods)

Might also be related to
http://www.tasharen.com/forum/index.php?topic=6705.msg57463#msg57463

Apparently it can be fixed by calling UIPanel.Refresh after activating branches in the hierarchy. At least it seems to fix it for now.

Using Unity 4.6.1f1 with pro licenses for mobile and Editor.

Is this expected behaviour, or should it just work?
Title: Re: Invisible sprites in 3.8.0 and earlier on mobile devices
Post by: ArenMook on February 27, 2015, 04:52:04 AM
Scale of zero is invalid. You can't divide by zero, so it's not possible to calculate the inverse of its transform. You should never scale to zero. Use a small value instead like 0.01.

After reparenting a UI element make sure to call its MarkParentAsChanged(). (you can also BroadcastMessage it).
Title: Re: Invisible sprites in 3.8.0 and earlier on mobile devices
Post by: ClockStone_Helmut on March 02, 2015, 03:26:57 AM
Thank you for the quick answer.

We will definitely remove the zero scaling in the animation, as it is most likely the frame rate dependent problem.

Please feel free to mark this thread as resolved.