Author Topic: My textures flicker as black/grey boxes on Nexus 7 after being minimized  (Read 3465 times)

bhandyTapblaze

  • Guest
I cannot give perfect details on this, as my QA source has described the error to me, but I have not seen it myself. It may not even be related to NGUI, but given the similarity to this topic, I want to explore the idea at least in case there's something I'm missing here.

Already, I found that the issue in the above topic was an issue in my game. That is now fixed, where previously I had a 2048x4096 texture, now everything is 2048x2048 for the Nexus 7 (whose max texture size is 2048).

Even so, in the process I found a Unity Answer that said Resize could also create a similar issue. It suggested that this code would work, which uses these functions...

  1.         tex.Resize (newWidth, newHeight);
  2.         tex.SetPixels32 (newColors);
  3.         tex.Apply();
  4.  

...so I double checked all the code in my project, and found that NGUI's UITexturePacker.cs file uses...

  1.         texture.Resize(width, height);
  2.         texture.SetPixels(new Color[width * height]);
  3.  

...and now my question is, why isn't Apply() used in NGUI? Is there any chance this could be causing my black and grey box problems (where textures end up as not what they should be, but instead as grey boxes that flicker to black (or potentially flicker to transparent on top of a black background))? This issue has only been seen on a Nexus 7 after minimizing the Unity game, then maximizing it later, and has not been tested since I fixed the atlas size issue (so I'm hoping to just be extra thorough in my fixes before sending it off for another round of testing).

Many thanks for any and all help!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: My textures flicker as black/grey boxes on Nexus 7 after being minimized
« Reply #1 on: December 18, 2013, 10:19:14 AM »
UITexturePacker class is an editor-only class that's also only used if you don't rely on Unity's built-in texture packing capabilities (which are used by default). So whatever your issue is, it's not with that file.

bhandyTapblaze

  • Guest
Re: My textures flicker as black/grey boxes on Nexus 7 after being minimized
« Reply #2 on: December 18, 2013, 07:26:58 PM »
Bummer! Alright, thanks for the help.