Author Topic: Text List bug with Unicode fonts?  (Read 3977 times)

ENAY

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 248
    • View Profile
Text List bug with Unicode fonts?
« on: May 28, 2012, 02:58:45 AM »
Have started today implementing a chat window but I am starting to get weird behaviour.

Even though I set my Max Height to 100, it doesn't clip it at 100 at all, it just goes on forever. Have been unable to figure it out but I believe it is down to the font used. For example when I open up "Example 12 Chat Window", if I try changing the SciFi font instead my own font. Weird things start happening, text doesn't appear etc. I guess this is down to how the font labels are being calculated right? I am using a Japanese unicode font, could this be the issue I wonder?


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Text List bug with Unicode fonts?
« Reply #1 on: May 28, 2012, 03:02:10 AM »
Max height? There is no such property.

ENAY

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 248
    • View Profile
Re: Text List bug with Unicode fonts?
« Reply #2 on: May 28, 2012, 03:05:28 AM »
There is "UIText List(Script)" has a property called "Max Height" it is set to 410 as default.

I think I am maybe understanding why the text is overflowing. If I manually input text whilst the program is running it overflows, I guess it is because a mesh update (rearranging of the new text) is not automatically being called?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Text List bug with Unicode fonts?
« Reply #3 on: May 28, 2012, 03:32:37 AM »
Oh, you're using a text list... sorry, I should have read the original post more carefully. You know you need to be adding text to your text list via UITextList.Add, right?

ENAY

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 248
    • View Profile
Re: Text List bug with Unicode fonts?
« Reply #4 on: May 28, 2012, 04:15:37 AM »
Yes I am doing that using UITextList.Add, I wasn't at first. Well I was just testing it out in the GUI, which in reality is a BAD thing to do since the behaviour is random. Everything is working fine now. Sorry for creating a potentially useless thread.

In a way though I am actually pleased I managed to solve this problem myself, it means I am finally getting better at Unity and using NGUI properly. Note for anyone else, don't manually change the text in the GUI, or else it ain't gonna work.

ENAY

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 248
    • View Profile
Re: Text List bug with Unicode fonts?
« Reply #5 on: May 28, 2012, 04:20:21 AM »
Actually I do have a question.

How do you change the colour in the middle of the text string?

I tried putting in stuff like "[FFFF00]" into the text string in code but it just prints out the text string instead of turning yellow. I noticed your example uses AAAAAA but I can't get that to work on mine.

ENAY

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 248
    • View Profile
Re: Text List bug with Unicode fonts?
« Reply #6 on: May 28, 2012, 04:50:13 AM »
DOH! I forgot to tick the encoding box  :o