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

sjames

  • Guest
Re: NGUI: HUD Text
« Reply #60 on: January 31, 2013, 02:55:12 PM »
Since the update I'm getting an error "You should never nest widgets! Parent them to a common game object instead. Forcefully changing the parent." It's only parent is the UIPanel. It errors each time I  use .Add(). Any ideas?

*edit* it's setting their parent as the UIPanel of hudtext adding them to the hudtext. ???
*edit2* reloaded ngui/hudtext and it works.  :o
« Last Edit: January 31, 2013, 03:39:59 PM by sjames »

null

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: NGUI: HUD Text
« Reply #61 on: January 31, 2013, 05:00:46 PM »
I’m not sure if I should be starting another topic ..

I purchased the HUD Text package and things seems to work fairly well but I seem to have a few issues.

First, I created  scene similar to the orc sample to play around with. When I turn off the main cameras look to action and “fly” the main camera around, the HUD text appears ahead of me, directly opposite of where they were hovering before. My second problem is when I create my UI root and HUD Text scripts the same way in another scene, the text appears not on the go but somewhere close to it. And when I fly the main camera around, the text swoops around not seeming to follow anything. I have other NGUI tooltip, orthogonal and other cameras in that scene. Could one of the cameras be tripping me up? My HUD root is on a separate layer than all the others.

Thanks in advance

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI: HUD Text
« Reply #62 on: February 01, 2013, 12:45:29 AM »
Sounds like you need to explicitly specify which cameras should be used on the UIFollowTarget object. It tries to find the camera automatically, and you have more than one camera able to see specific layers, so it's not sure which one should be chosen.

null

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: NGUI: HUD Text
« Reply #63 on: February 01, 2013, 11:50:00 AM »
I fixed my problem of the HUD text acting wonky but there is still the issue of the HUD text appearing when the main camera is rotated 180. Orc example 1 with the Look at script disabled and the main camera rotated. There is even the floating text waaay in the distance. Any thoughts on this one?


Thanks



ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI: HUD Text
« Reply #64 on: February 01, 2013, 01:30:59 PM »
You need to update to the latest version.

stevej

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 117
    • View Profile
Re: NGUI: HUD Text
« Reply #65 on: February 07, 2013, 04:23:29 AM »
Is there a simple way to set the depth on the HUDText item? e.g. I'd like to set its follow target to be another NGUI UISprite object, and have the HUDText appear on top of it.

EDIT: Nevermind - figured out how to do it with a second UI camera at a higher depth showing those HUDText items.
« Last Edit: February 07, 2013, 04:47:23 AM by stevej »

thempus

  • Guest
Re: NGUI: HUD Text
« Reply #66 on: February 10, 2013, 08:12:02 PM »
Is there a way to improve the performance of UIFollowTarget when using around 100 objects displaying at the same time on the screen? On my tests, it is slow too run on iOS.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI: HUD Text
« Reply #67 on: February 10, 2013, 10:45:38 PM »
You could write one script to track 100 number of objects instead of having 100 individual scripts. That's assuming the slowdown actually comes from UIFollowTarget. My guess is that it actually comes from having to rebuild the UI every frame as all 100 widgets need to re-write themselves into the draw buffer every frame.

I'd recommend minimizing that, if possible.

thempus

  • Guest
Re: NGUI: HUD Text
« Reply #68 on: February 10, 2013, 11:13:10 PM »
Thanks for your suggestion, I will try to write one script to track all objects instead of 1 script per object, it makes sense and I haven't seen from that angle before.

thempus

  • Guest
Re: NGUI: HUD Text
« Reply #69 on: February 12, 2013, 01:05:29 AM »
Ok, I've found out what was the problem, and it wasn't ngui of course. Somehow I managed to accidentally put a Rigidbody to the UI Root, and that was slowing down everything.

Anyway I'm using your suggestion and it's helping a lot.

Thanks

SirGive

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: NGUI: HUD Text
« Reply #70 on: February 14, 2013, 07:01:31 PM »
Hey Aren,

I just bought your package today. Its great! Only thing I wanted to make sure you were aware of was that it appears to not fade out the shadow on the text (if enabled), so it fades to black and then disappears. Unless for some reason my Unity downloaded the wrong version, then never mind! I've attached a reference screenie. The alpha on the actual text is 0, but the shadow is still full at 255. Not something I personally have a problem fixing. :)

*Saved as .gif cause it was apparently too big - don't mind the artifact.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI: HUD Text
« Reply #71 on: February 14, 2013, 09:13:19 PM »
Which version of NGUI do you have in there, SirGive? The latest full version should work fine.

SirGive

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: NGUI: HUD Text
« Reply #72 on: February 14, 2013, 09:16:44 PM »
I've got NGUI 2.3.3 and HUD Text 1.6

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI: HUD Text
« Reply #73 on: February 14, 2013, 09:25:13 PM »
You're right, I will push a fix.

SirGive

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: NGUI: HUD Text
« Reply #74 on: February 14, 2013, 09:32:07 PM »
Awesome! Very much appreciate the support.