Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

NGUI: HUD Text

Discussion in 'Assets and Asset Store' started by ArenMook, Jul 12, 2012.

  1. cpasjuste

    cpasjuste

    Joined:
    Apr 2, 2012
    Posts:
    154
    Hi,

    First thanks, the result is nice and saved some time :)
    Thought the usage could be simplier, the impossibility to attach the HUDText directly on any GameObject outside NGUI panel is a brake on the workflow for me.

    So i did a very few changes to have the ability to specify the NGUI parent gameobject in a HUDText script so it can be attached to any gameobject in the scene (create a parent for the labels in the specified NGUI parent, then attach UIFollow on it). I also added a target option to HUDText so you can easly target a specific position. I'm sure you understand what i mean but let me know if you need the modified script.

    Thanks,
    David.
     
  2. GamePowerNetwork

    GamePowerNetwork

    Joined:
    Sep 23, 2012
    Posts:
    257
    Can you add custom NGUI sprites for the hud? ... so that something like Playstation Home speech bubbles could be recreated?

     
  3. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    @cpasjuste: Why couldn't you do it before? Add a child game object to your 3D object, make it face the camera / scale it, attach a UIPanel to it, add a child HUDText and there you go, HUDText in 3D.

    @PyroStudios: Yeah. UIFollowTarget script will make any 2D UI object follow a 3D game object -- whether it's HUDText, a UI widget, or a game object that has both as children. You can see it in use in Windward (http://www.tasharen.com/windward/) -- I have health bars and HUDText following units, all children of a single UIFollowTarget game object (per unit)
     
  4. HeadHunter2009

    HeadHunter2009

    Joined:
    Jul 3, 2012
    Posts:
    50
    Wery cool) We made the same thing using NGUI ourself some time ago:
    DarkWaters:

    BlockStory:
     
  5. cpasjuste

    cpasjuste

    Joined:
    Apr 2, 2012
    Posts:
    154
    Well if I'm correct each panel is one draw call so it's not an option for me!
     
    Last edited: Jan 27, 2013
  6. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    That's true, they would be. If all your game objects are children of one game object though, you can put a panel there instead.

    GameRoot (UIPanel)
    - Orc 1
    --- HUDText
    - Orc 2
    --- HUDText

    ..etc
     
  7. HeadHunter2009

    HeadHunter2009

    Joined:
    Jul 3, 2012
    Posts:
    50
    ArenMook, there one problem with this. If you place UIPanel on root and child gamobjects moves, then it trigger widgets to update, and profile show this wery expencive, more expencive then new drawcall.
     
  8. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Ideally you should have all your HUDText and other HUD objects under one UIPanel, and nothing else underneath. All your game windows etc would be separate.
     
  9. cpasjuste

    cpasjuste

    Joined:
    Apr 2, 2012
    Posts:
    154
    Hi ArenMook,

    are you saying that putting all the hud text under a separate panel would improve fillrate? If so, would you have the time to explain :D

    Else would it be possible to add a parameter to set the maxium number of hud text per object, to improve the performances ?

    Thanks !
    David.
     
  10. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Fillrate? No. Fillrate is drawing to the same part of the screen repeatedly. Using unique panels may result in better performance at the cost of extra draw calls. It's one of those things you can play with to see the effect.
     
  11. 99thmonkey

    99thmonkey

    Joined:
    Aug 10, 2012
    Posts:
    525
    I really like the Windward progress bars (curved). Guess I need to learn how to make those kinds of custom things. I have NGUI. I'd really like to see the next update contain those kinds of bars, and others (like maybe a full circle). I plan on buying HUD Text once the Asset Store can figure out how to take my money (not sure what the issue is).
     
  12. Pauls

    Pauls

    Joined:
    Nov 12, 2012
    Posts:
    46
    Hi Aren, I was thinking this extension could be in the ngui package? Or with a lower price? I am happy with NGUI, I just feel after the 95$, it is a bit expensive.
     
    Gaviathan2 likes this.
  13. mcconrad

    mcconrad

    Joined:
    Jul 16, 2013
    Posts:
    155
    how does one destroy an instantiated hud text with a uifollowtarget script after the target has been destroyed? i keep checking if target == null, but that itself gives me a null reference error.
     
  14. 7474Bomber

    7474Bomber

    Joined:
    Nov 24, 2013
    Posts:
    1
    Hi I really like this asset, and works great!
    One thing I'd like to ask is, would be possible to draw borders around the text so it looks like some kind of speech bubbles?
     
  15. Tripwire

    Tripwire

    Joined:
    Oct 12, 2010
    Posts:
    442
    Hi ArenMook,

    Is it possible to set the Z of the created Text? I want my text to show in front of an other texture instead of below it.
     
  16. nbg_yalta

    nbg_yalta

    Joined:
    Oct 3, 2012
    Posts:
    378
    Got a strange flick bug, while calling HudText.Add() with Animation Event, some kind of flickering, any ideas?