1
NGUI 3 Support / Re: I have a problem with activating widgets
« on: March 27, 2017, 12:36:54 AM »Did it get broken yet again? That method was changed about 2 months ago to fix something in 5.5.X. Which version of it works this time around? Can you paste the code that's working?
Sure.
The following is the code I pasted.
- static void OnFontChanged (Font font)
- {
- for (int i = 0; i < mList.size; ++i)
- {
- UILabel lbl = mList[i];
- if (lbl != null)
- {
- Font fnt = lbl.trueTypeFont;
- if (fnt == font)
- {
- fnt.RequestCharactersInTexture(lbl.mText, lbl.mFinalFontSize, lbl.mFontStyle);
- lbl.MarkAsChanged();
- if (lbl.panel == null)
- lbl.CreatePanel();
- if (mTempDrawcalls == null)
- if (lbl.drawCall != null && !mTempDrawcalls.Contains(lbl.drawCall))
- mTempDrawcalls.Add(lbl.drawCall);
- }
- }
- }
- if (mTempDrawcalls != null)
- {
- for (int i = 0, imax = mTempDrawcalls.size; i < imax; ++i)
- {
- UIDrawCall dc = mTempDrawcalls[i];
- if (dc.panel != null) dc.panel.FillDrawCall(dc);
- }
- mTempDrawcalls.Clear();
- }
- }
I copied this code from version 3.9.4, and it doesn't have any problems yet.


