Author Topic: Dynamically updating UILabel doesn't clear old text  (Read 2173 times)

gregorypierce

  • Guest
Dynamically updating UILabel doesn't clear old text
« on: December 15, 2012, 03:21:06 AM »
I have some data that I am pulling from a service and in that service I'm calling

  1.         void displayLocation()
  2.         {
  3.                 if ( uiLabel != null )
  4.                 {
  5.                         uiLabel.text = "Location: (" + Input.location.lastData.latitude + "," + Input.location.lastData.longitude + ")";
  6.                 }
  7.         }

However what I'm getting back on the screen is that each label is overwriting the other. This is a very simple scene consisting of just the service and a 2D UI with a Panel and a UILabel on it. I'm a little bit at a loss as to why it doesn't appear that the buffer is being cleared between frames (or similar) because that's the effect that I'm seeing. Everytime the displayLocation is called, the new text is being drawn right on top of the old text.

gregorypierce

  • Guest
Re: Dynamically updating UILabel doesn't clear old text
« Reply #1 on: December 15, 2012, 04:17:20 AM »
This is what I get for writing code so late in the evening. Somewhere, Unity4 changed the camera for NGUI (likely when I removed the main camera after both had been in the scene) such that the NGUI Camera was only clearing the Depth Buffer.

 :-[

Going to bed is probably a good idea now.