Author Topic: UILabel  (Read 164931 times)

moursbourn

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: UILabel
« Reply #15 on: December 30, 2013, 10:18:31 PM »
color via the [color] [-] flag is being multiplied with the font color.   I seem to remember this used to replace the color. Is this a bug or intended?  It seems much more useful as a replacement, even if it does replace the gradient.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UILabel
« Reply #16 on: December 31, 2013, 07:29:57 AM »
Intentional. Widget's color tint affects everything. Do something like this instead now:
  1. label.text = "[000000]Black [ff0000]Red";

jinsediaoying

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: UILabel
« Reply #17 on: January 10, 2014, 02:46:40 PM »
do this support custom font that create via Assets->create-> custom font?
UILabel can recognize it as a dynamic font, but throws a tons of errors

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UILabel
« Reply #18 on: January 10, 2014, 06:20:51 PM »
No, custom font feature is something new in Unity and I have not yet looked at it.

AGB

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 74
    • View Profile
    • Steam Defense
Re: UILabel
« Reply #19 on: January 21, 2014, 02:16:48 AM »
What are the tags for new font modify functions? maybe there are more?
I'm a busy man... I have places to go,monsters to kill...

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UILabel
« Reply #20 on: January 21, 2014, 04:17:04 AM »
BBcode style:

[b]bold[/b]
[i]italic[/i]
[u]underline[/u]
[s]strikethrough[/s]

...etc. Look inside NGUIText.ParseSymbol.
« Last Edit: January 21, 2014, 04:46:24 AM by ArenMook »

dannygame2012

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: UILabel
« Reply #21 on: January 22, 2014, 09:28:45 PM »
I want to add an emoticon to my dynamic font ? can I?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UILabel
« Reply #22 on: January 23, 2014, 07:11:06 AM »
Not yet.

dannygame2012

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: UILabel
« Reply #23 on: January 23, 2014, 11:32:18 PM »
next version can support this feature?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UILabel
« Reply #24 on: January 24, 2014, 10:44:43 AM »
A day later? Still not yet.

dbuck

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: UILabel
« Reply #25 on: January 27, 2014, 10:54:47 AM »
Hey Aren, Is there anything set up to do Bulleted text?

Thinking I'll parse the lines for the beginning bullet char: '\u2022' and split those lines into a separate indented label, and place the whole listing of the text copy within a table. Is there currently an easier way to get that effect?

Quote
Titled
  • Yea.
  • These are fun
And copy

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UILabel
« Reply #26 on: January 27, 2014, 07:05:58 PM »
No, there is nothing in NGUI that would parse bullet text / paragraphs.

ury2ok2000

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: UILabel
« Reply #27 on: January 30, 2014, 12:49:25 PM »
I hope this is the right place to ask this. I am trying to get a label to appear over a game object. However when I try to set the position it always appears at 0,0,0 (center of the screen). The only exception is if I change the label position in the script's update.

I am instantiating a label prefab with the text script attached.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UILabel
« Reply #28 on: January 31, 2014, 12:40:44 PM »
Label should remain in your UI hierarchy. You can anchor widgets to 3D objects quite easily. Consult the UIRect documentation page for details.

Denis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: UILabel
« Reply #29 on: February 13, 2014, 02:25:28 AM »
From glancing at documentation and very briefly skimming the code, it seems there are no formatting controls that would allow me to do something like a table. E.g.

  Column1   Column2  Column3
  Value1     Value2    Value3

What do you recommend for me to be able to achieve this?  Offhand, some options I can think of:

A) use 3 overlapping UILabels, clipping to mutually exclusive spaces.
B) use a monospaced font and pad with spaces. Actually, will this work? I did a quick test and it seems that padding with spaces doesn't work.
C) modify code and add new formatting controls. E.g. [150] means jump to 150 pixel offset.  This is the solution I've implemented in a couple of other engines. This would allow me to do a table with one UILabel. Not sure how complex this addition is, though. Seems like it should be straightforward if I know the places to hook into that do positioning.  What are those hooks?

thanks