Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: BenMPG on October 20, 2014, 01:40:03 PM

Title: Dynamic Font Issue - Delay When First Displayed
Post by: BenMPG on October 20, 2014, 01:40:03 PM
Hello,

Unity Pro v. 4.5.5.
NGUI v. 3.7.4.

I've read a lot about Unity issues with dynamic fonts, but haven't found any posts relating to my specific issue, so I thought I'd ask here.


I have a panel with 6 labels, a couple of buttons and a collection of sprites, which is shown when a user selects a level.

The first time the panel is shown, there is a pause / delay before it appears.  This can be anything from 2 frames, to 20 frames (at 60fps).

If I take out all the labels (but keep the buttons, sprites and effects), there is no pause.  Put the labels back in, the pause occurs.

The labels all fit - ProcessText in UILabel is getting called once per label, as you would expect, so there is no re-sizing going on or any anything else untoward.

This happens on all my other message panels also (e.g. Level Success, Level Failure, Quit Game).  If there is no text, there is no delay, and the delay only occurs the first time each panel is shown.


I have tried many things.  Instantiate replaced with SetActive.  Small font size.  Pre-loading the font.  No real-time text updating (i.e. just use the labels as they were created in the editor).  No joy.


I haven't got Android Pro....yet, otherwise I'd be able to profile and give more information.  I am hoping someone has seen this before and be able to explain what it going on such that I can (a) fix the issue, or (b) put in a work-around in.

Thanks for reading, and for any assistance you can offer.
Title: Re: Dynamic Font Issue - Delay When First Displayed
Post by: ArenMook on October 20, 2014, 11:38:58 PM
When you try to draw something via dynamic text, Unity has to first generate the texture for it. That takes time.