Author Topic: Images no longer Displaying on Device (only editor)  (Read 8637 times)

CoderBear

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 34
    • View Profile
Images no longer Displaying on Device (only editor)
« on: April 02, 2013, 02:08:05 PM »
I had a working menu with NGUI.  It displayed properly when both running from the editor and running on Android Devices (I'm using a Nexus 7 and an Atrix 4G).

I have recently updated to v2.5 of NGUI and Unity 4.1 and now when it is pushed to the device and run it displays only a black screen.  However it is only not displaying the sprites, the functionality of the buttons are still present because it will still make a sound and activate scripts taking me to the other scenes when corresponding buttons are pressed.

Why exactly is this happening and what can I do to fix it?

Zarack

  • Guest
Re: Images no longer Displaying on Device (only editor)
« Reply #1 on: April 02, 2013, 03:18:16 PM »
I had some strange things happening when I only had GUI in the scene. Something about the camera culling mask and clear flags helped me out.

Is everything parented properly? No nesting of widgets and whatnot/whathaveyou?

CoderBear

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 34
    • View Profile
Re: Images no longer Displaying on Device (only editor)
« Reply #2 on: April 02, 2013, 04:06:48 PM »
I tried that and it still is a blank image.

Yes everything is correctly parented and I haven't changed anything from the working version.  So really have no idea what is going on.  But it is really annoying that it is happening.

Zarack

  • Guest
Re: Images no longer Displaying on Device (only editor)
« Reply #3 on: April 02, 2013, 04:14:25 PM »
I'm curious, is it only NGUI stuff in this scene? Or do you have any meshes/particles/etc. I'd throw a primitive or a model in there and see if the camera is able to see it. Troubleshoot and pray. Unfortunately, you're probably going to need someone a bit more experienced with NGUI than I.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Images no longer Displaying on Device (only editor)
« Reply #4 on: April 02, 2013, 10:46:39 PM »
Camera clear flags are generally the cause in these situations, yes. In particular pay close attention to the clear color itself (Unity defaults it to have an alpha of 5 out of 255, which messes up some android devices), and the actual clear setting. If your UI camera is set to clear color or skybox, then everything drawn before it will be wiped out. Also make sure that the UI camera has a higher depth than the game camera.

CoderBear

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 34
    • View Profile
Re: Images no longer Displaying on Device (only editor)
« Reply #5 on: April 03, 2013, 01:15:13 PM »
As suggested initially via tutorials and BZA youtube channel I had the Clear flags set to depth only from the beginning.  The only change that was made was upgrading to the latest version of NGUI (2.5.0).

the first Picture shows the screen from my device.  The second picture shows the editor window with the camera settings.

CoderBear

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 34
    • View Profile
Re: Images no longer Displaying on Device (only editor)
« Reply #6 on: April 03, 2013, 03:09:17 PM »
I also created a new project with just NGUI and created a single sprite background and then B&R onto my device and it displays again.

So I thought all I had to do was re-import NGUI.  That had no effect.  So I tried deleting NGUI and then importing the new version.  Again no affect.  Then I thought to use a new scene and have a fresh NGUI setup.  And I only had one sprite on there and it is giving me a black screen.  So you might be able to imagine my frustration.

That after all the hard work I poured into this project over 3 weeks I have to stop and create a new project just to get the UI up and running again.  Yet I still have no issue why the problem started in the first place.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Images no longer Displaying on Device (only editor)
« Reply #7 on: April 03, 2013, 05:15:44 PM »
Not sure what to tell you. I'm working with an Android device on daily basis here, and the UI works perfectly fine. If you start a brand-new project, import NGUI, and it works fine, then the problem is in your project's settings somewhere, such as stripping and/or GLES version.

CoderBear

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 34
    • View Profile
Re: Images no longer Displaying on Device (only editor)
« Reply #8 on: April 04, 2013, 01:34:50 PM »
The problem as best I can figure was in updating NGUI.  As the two times I have updated via the Unity Asset Store it has crashed Unity.  Something during that time had to have corrupted a file.

Because yes I started a new project and it now works fine.  Also using the same exact project settings as the project that is now not displaying sprites.  Yet that can't really be the solution.  As it then sets me back every time there is an update to NGUI.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Images no longer Displaying on Device (only editor)
« Reply #9 on: April 05, 2013, 12:19:54 PM »
Do you follow NGUI's update instructions that involve starting a new scene, deleting NGUI folder, and importing from the latest package?

CoderBear

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 34
    • View Profile
Re: Images no longer Displaying on Device (only editor)
« Reply #10 on: April 05, 2013, 02:14:08 PM »
I found out what the issue was, for some reason the atlas was bigger than 2048x2048 and that is why the textures had started to only display black.  Which by the grace of god I figured out as I was having a similar issue with the backgrounds rendering to black on Android Devices.

Which again I find that part of the blame should fall on the developers for not issuing a statement that textures for use on Android should be limited to 2048x2048.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Images no longer Displaying on Device (only editor)
« Reply #11 on: April 05, 2013, 07:34:12 PM »
Which developers? ;) It's a hardware restraint.