Author Topic: NGUI: HUD Text  (Read 164004 times)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: NGUI: HUD Text
« Reply #150 on: November 13, 2013, 03:11:08 PM »
Set the label to shrink to fit or wrap mode, give it a size you want it to be at its maximum, and give it a left pivot (top left, left, or bottom left).

droweed

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 1
  • Posts: 16
    • View Profile
Re: NGUI: HUD Text
« Reply #151 on: November 14, 2013, 09:14:37 AM »
thanks!! :D
works like a charm

grunchgrunch

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: NGUI: HUD Text
« Reply #152 on: November 18, 2013, 11:22:08 AM »
Hello !
First of all, thank you for your great plugin !

I'm having an issue, the text is still showing up even when there is an obstacle between the target object (UIFollow) and the camera.

Any advice ?

Thanx in advance !

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: NGUI: HUD Text
« Reply #153 on: November 18, 2013, 11:55:23 AM »
It doesn't do raycasting. If you want it hidden, I suggest you perform a raycast periodically (toward the camera) and if something is hit, hide the HUD element.

grunchgrunch

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: NGUI: HUD Text
« Reply #154 on: November 18, 2013, 03:38:29 PM »
Ok, thank you for your quick answer !

jeldrez

  • Sr. Member
  • ****
  • Thank You
  • -Given: 8
  • -Receive: 4
  • Posts: 352
    • View Profile
Re: NGUI: HUD Text
« Reply #155 on: November 21, 2013, 12:50:32 PM »
Aren, could you create a topic just for when you update HUD Text? So people interest on it can get notified when it's updated.
Please!

Thanks.

jeldrez

  • Sr. Member
  • ****
  • Thank You
  • -Given: 8
  • -Receive: 4
  • Posts: 352
    • View Profile
Re: NGUI: HUD Text
« Reply #156 on: December 09, 2013, 10:50:38 AM »
When it's going to be the dynamic fonts supported on HUD Text?

triawyn

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: NGUI: HUD Text
« Reply #157 on: December 10, 2013, 11:26:53 AM »
i just upgraded NGUI to full version 3 (.07 or so) and now my HUD text is HUGE, basically takes up the entire screen when called.  i saw earlier post that this was corrected in 1.7, however i am using 1.8 already and there is no new update on the asset store...

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: NGUI: HUD Text
« Reply #158 on: December 11, 2013, 12:20:13 AM »
You need to bring in your HUDText prefabs into the scene in order for them to get upgraded. You then need to Apply the changes. It's mentioned in the NGUI upgrade instructions.

P.S. I just updated it with support for recent NGUI features such as gradients and dynamic fonts.
« Last Edit: December 11, 2013, 01:44:30 AM by ArenMook »

triawyn

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: NGUI: HUD Text
« Reply #159 on: December 11, 2013, 08:49:42 AM »
what if i am not using prefabs?  i have objects already in the scene that i simply added the UIfollow and Hudtext scripts to.  they aren't prefabs and don't need to be instantiated.  do i need to make them into prefabs and then remove the originals and replace those with the prefabs?

triawyn

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: NGUI: HUD Text
« Reply #160 on: December 13, 2013, 08:42:37 AM »
i removed all the scaling from the HUDtext transforms, however i still have a couple more problems.  words and phrases are being split into 2 lines and i do not see any way outside of the code itself to increase the line width of the HUDtext.  for example, a word like "massive" becomes "mass" on one line and "ive" on the next.

also the hudtext no longer is scrolling up as it fades out.  i have not changed the curves since upgrading to NGUI 3 so i dont know why that is not occurring.
« Last Edit: December 13, 2013, 09:05:41 AM by triawyn »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: NGUI: HUD Text
« Reply #161 on: December 13, 2013, 10:02:20 AM »
Without your project to look at, all I can say is check to see how it differs from the example scenes that come with HUDText (example two in particular).

HUDText's labels are also set to "resize freely", meaning they have no width or height, so there is nothing that would cause them to start a new line unless you've changed this behaviour. You can check this by pausing the game and selecting one of HUDText's labels.

Scrolling up also occurs just fine in the 2nd example.

triawyn

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: NGUI: HUD Text
« Reply #162 on: December 13, 2013, 08:22:43 PM »
Without your project to look at, all I can say is check to see how it differs from the example scenes that come with HUDText (example two in particular).

HUDText's labels are also set to "resize freely", meaning they have no width or height, so there is nothing that would cause them to start a new line unless you've changed this behaviour. You can check this by pausing the game and selecting one of HUDText's labels.

Scrolling up also occurs just fine in the 2nd example.

thank you.  i was able to find the problem with the multi-line issue.  for some reason that line in the code (UILabel.Overflow.ResizeFreely;) had been commented out.
« Last Edit: December 13, 2013, 08:27:52 PM by triawyn »

sberghici

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 26
    • View Profile
Re: NGUI: HUD Text
« Reply #163 on: December 18, 2013, 10:37:29 PM »
Yup. Just use the standard color encoding like so: "[ff0000]Red[-] and [00ff00]Green[-]".

Hi Aren
I've recently upgraded my project from NGUI 2.7 to 3.0.7 and my multicolor text does not work anymore. Please advice.   

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: NGUI: HUD Text
« Reply #164 on: December 19, 2013, 12:38:22 PM »
Don't use the darker color tinting if you embed colors. Embed the darker color as well.

label.text = "[000000]Black [ff0000]Red";