Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Konstantin

Pages: [1]
1
The resulting image is posted to Facebook, hence the size requirements. Seems I need another way of putting text on it.

2
I have a separate camera that renders NGUI to a RenderTexture. Size of the texture is different (sometimes a lot) from the screen size. Sprites are all right but I get blurry text.

So far I have done:
- removed UIRoot, UICamera
- set valid orthographicSize and aspect in my camera using custom script
- set all scales to 1
- checked that all transforms are integer
- set Keep crisp = Always

In my rendering script
1. set all text values in UILabels
2. GetComponent<UIPanel>().Refresh();
3. camera.Render()

Camera component is disabled all the time as it renders pictures on demand only.
I have tried calling some UILabel methods before rendering with no luck.
I can get crisp text if I fiddle with one of the UILabels in the scene view after running the scene. That updates all labels at once and they remain crisp.

3
Let's assume we have a scene with Localization script. It is loaded twice and Localization is duplicated. The second instance will destroy itself, but it will also break static fields. Here is some code from Localization.cs:

  1. void Awake ()
  2. {
  3.         if (mInstance == null) // mInstance is not null, this is the second Localization
  4.         {
  5.         ...
  6.         }
  7.         else Destroy(gameObject); // Destroy duplicate which will call OnDisable
  8. }
  9.  
  10. void OnDisable ()
  11. {
  12.         localizationHasBeenSet = false;
  13.         mLanguageIndex = -1;
  14.         mDictionary.Clear(); // BOOM! current locale texts wiped out
  15.         mOldDictionary.Clear();
  16. }
  17.  

4
NGUI 3 Support / Re: UIDrawCall leaks if destroyed
« on: February 03, 2014, 06:18:53 AM »
Updated to 3.4.8. Added following code...
  1. UIDrawCall.ReleaseInactive();
  2. Resources.UnloadUnusedAssets();
  3.  
...and the texture is gone from memory! Excellent. Thank you for support.

5
NGUI 3 Support / Re: UIDrawCall leaks if destroyed
« on: January 29, 2014, 09:20:45 AM »
Can I force a UIPanel to be destroyed completely with all its draw calls? I am absolutely sure that my draw call will not be reused and I want my 3MB of memory back :-)

6
NGUI 3 Support / UIDrawCall leaks if destroyed
« on: January 29, 2014, 07:22:20 AM »
From UIDrawCall

  1. static public void Destroy (UIDrawCall dc)
  2.         {
  3.                 if (dc)
  4.                 {
  5.                         if (Application.isPlaying)
  6.                         {
  7.                                 if (mActiveList.Remove(dc))
  8.                                 {
  9.                                         NGUITools.SetActive(dc.gameObject, false);
  10.                                         mInactiveList.Add(dc); // Leak!
  11.                                 }
  12.                         }
  13.                         else
  14.                         {
  15.                                 mActiveList.Remove(dc);
  16.                                 NGUITools.DestroyImmediate(dc.gameObject);
  17.                         }
  18.                 }
  19.         }
  20.  

Note that OnDestroy does not remove the UIDrawCall from any list. The UIDrawCall is stuck in the static mInactiveList until ReleaseAll is called which happens after last UIPanel is disabled.

Pages: [1]