Author Topic: label.text does not work on android‏  (Read 1813 times)

meganuke

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 33
    • View Profile
label.text does not work on android‏
« on: April 02, 2014, 04:39:32 PM »
hello there!!

i imported a new asset
the terrain for mobile to be specific  (this one: http://u3d.as/content/azert2k/t4m-source-codes-edition/1Ec)

when in converted the terrain to object, the label stoped working.

i was using it this way:

  1. label.text = format;
(format is a string)


now it doesnt work.
the label appear on screen but it only shows the initial value. i cant update it.

i created a second label and had the same problem.


i went to the UILabel script
and changed the "text" method to this:


  1.         public string text
  2.         {
  3.                 get
  4.                 {
  5.                         return mText;
  6.                 }
  7.                 set
  8.                 {
  9.                         GUI.Box(new Rect(500,50,200,40), mText);
  10.                         .........
  11.                         .....
  12.  

but nothing happens... so the text method is not being executed.

but if i put the "GUI.Box....." , before the "label.text=format" , then i can see the value on screen...

so ... there is something in between...

how, and were could i debug this???


please note that it works fine in the unity editor, but not in the android device.

thanks in advance!


ps. i am using version 3.5.1
ps2. please let me know if i wasnt clear.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: label.text does not work on android‏
« Reply #1 on: April 02, 2014, 06:04:05 PM »
Huh? GUI.Box is Unity's built-in system, not NGUI. What are you doing mixing the two? Unity's immediate mode GUI can only be used from inside OnGUI. NGUI has NOTHING to do with imGUI.

meganuke

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 33
    • View Profile
Re: label.text does not work on android‏
« Reply #2 on: April 02, 2014, 07:27:45 PM »
i used the gui.box as a debug system, since the problem only appear on the android device.

i "solved" this, by deleting all the t4m files.
and only importing the 4 files that are actually used on realtime.

i updated to latest version and had the same problem

and yes, it is that way if you import t4m sc. some stuff of ngui stops working