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

joduffy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 28
    • View Profile
Re: NGUI: HUD Text
« Reply #45 on: December 06, 2012, 10:52:29 PM »
Awesome.

I am going to get the extension then.
NGUI  makes things a lot easier then coding the GUI by hand in the default way.

I had a friend tell me they couldnt get a dll file to compile so from their experience the extension doesnt work on mobile platforms.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: NGUI: HUD Text
« Reply #46 on: December 07, 2012, 04:41:34 AM »
That's the free version of NGUI. It doesn't work on iOS I believe. Full version of NGUI works fine.

The HUDText kit comes with the distribution version of NGUI (which has the same limitations as Free). It's there as a stand-alone example, but since it's an extension to NGUI, having the full version of NGUI helps.

joduffy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 28
    • View Profile
Re: NGUI: HUD Text
« Reply #47 on: December 08, 2012, 08:33:48 PM »
Thanks for you help.
Ill pass that information onto my friend and see if that solves his problem.

:)

ekilog

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: NGUI: HUD Text
« Reply #48 on: December 18, 2012, 03:42:56 PM »
Delete LookAtTarget from HUDText (or dont import it). I'll fix it in the next update -- it seems the metadata changed.

Hello,

I got NGUI full version and I just purchased HUD Text and cannot get rid of the compilation error. What should I do ?
UNITY 4 PRO + IOS.
error are :

Assets/NGUI/Scripts/UI/UISlicedSprite.cs(140,30): error CS0115: `UISlicedSprite.OnFill(BetterList<UnityEngine.Vector3>, BetterList<UnityEngine.Vector2>, BetterList<UnityEngine.Color32>)' is marked as an override but no suitable method found to override

Assets/NGUI/Scripts/UI/UITexture.cs(124,33): error CS0546: `UITexture.mainTexture.set': cannot override because `UIWidget.mainTexture' does not have an overridable set accessor

Assets/NGUI/Scripts/UI/UITexture.cs(124,33): error CS0506: `UITexture.mainTexture': cannot override inherited member `UIWidget.mainTexture' because it is not marked virtual, abstract or override

Assets/NGUI/Scripts/UI/UITexture.cs(177,30): error CS0505: `UITexture.OnFill(BetterList<UnityEngine.Vector3>, BetterList<UnityEngine.Vector2>, BetterList<UnityEngine.Color32>)': cannot override because `UIWidget.OnFill(BetterList<UnityEngine.Vector3>, BetterList<UnityEngine.Vector2>, BetterList<UnityEngine.Color>)' is not a method

Assets/NGUI/Scripts/UI/UITiledSprite.cs(50,30): error CS0115: `UITiledSprite.OnFill(BetterList<UnityEngine.Vector3>, BetterList<UnityEngine.Vector2>, BetterList<UnityEngine.Color32>)' is marked as an override but no suitable method found to override


thanks.

Hervé
« Last Edit: December 18, 2012, 03:59:48 PM by ekilog »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: NGUI: HUD Text
« Reply #49 on: December 18, 2012, 10:51:37 PM »
You need to follow the upgrade instructions carefully. Import HUDText, delete the NGUI folder, import the full version of NGUI.

neken

  • Guest
Re: NGUI: HUD Text
« Reply #50 on: January 13, 2013, 07:37:56 AM »
Hi,

I want to display and follow HUDText on my all enemies individually then i need have multiple UIFollowTarget and one HUDText or i need to duplicate like Enemies.Count = HudText+UIFollow ?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: NGUI: HUD Text
« Reply #51 on: January 13, 2013, 11:53:49 AM »
Multiple UIFollowTarget+HUDText combinations. Each Unit should create their own.

Straiker

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: NGUI: HUD Text
« Reply #52 on: January 22, 2013, 05:24:16 AM »
Hi,

When I change the scene, HUDtext not displayed, but if I load the stage at once that has HUDtext all works. What is the Problem?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: NGUI: HUD Text
« Reply #53 on: January 22, 2013, 08:32:31 AM »
Look closer at what's different. HUDText works either way -- in Windward I change scenes all the time (going from menu to different levels) and HUDText works just fine. Check the UI hierarchy and but some Debug.Logs to figure out where your HUDText gets instantiated.

sjames

  • Guest
Re: NGUI: HUD Text
« Reply #54 on: January 24, 2013, 06:02:50 PM »
I'm interested in creating an object pool for HUDText prefabs I've Instantiated so that I can reuse them and move existing ones to different points, or create new ones if they're all in use. Is there something something similar to IsAlive ( particle effects ) that can be used to determine if it's still displaying anything, or will I have to write that. Also what is the proper way to add them to a panel? NGUITools.AddChild() takes gameobjects as arguments.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: NGUI: HUD Text
« Reply #55 on: January 24, 2013, 06:23:23 PM »
Generally if the UIFollowTarget has a null target, then it's not following anything, and can be safely recycled.

sjames

  • Guest
Re: NGUI: HUD Text
« Reply #56 on: January 25, 2013, 12:35:37 AM »
I don't destroy the GameObjects that would be the targets as they're pooled for reuse, so the target isn't null unless I set it to be.

sjames

  • Guest
Re: NGUI: HUD Text
« Reply #57 on: January 25, 2013, 11:44:46 PM »
Anyone looking to create a pool with them, you can use IsVisible to see if they're done.

stevej

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 117
    • View Profile
Re: NGUI: HUD Text
« Reply #58 on: January 30, 2013, 04:38:40 AM »
I'm having trouble getting the HUDText to actually appear on/near the GameObject.

Beneath my main UI hierarchy, I've added an empty object called UIHUDTextManagerCollection.

On each of my monsters, I have the following code in their Start() function:

  1. GameObject htManager = Instantiate(hudTextManager, transform.position, Quaternion.identity) as GameObject;
  2. htManager.GetComponent<UIFollowTarget>().target = transform;
  3. htManager.GetComponent<UIFollowTarget>().uiCamera = GameObject.Find("Camera").GetComponent<Camera>();                  
  4. htManager.transform.parent = GameObject.Find("UIHUDTextManagerCollection").transform;
  5. htManager.transform.localScale = new Vector3(1.0f, 1.0f, 1.0f);
  6. htManager.name = recordableObject.globalId;
  7.  

When I run the game, I can see that the monster has instantiated a hudTextManager, renamed it, placed it under the UIHUDTextManagerCollection object, etc. BUT the actual text is miles away from the monster that owns it.

What am I doing wrong?


stevej

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 117
    • View Profile
Re: NGUI: HUD Text
« Reply #59 on: January 30, 2013, 05:12:46 AM »
Nevermind - got things sorted switching to:

  1. GameObject htManager = NGUITools.AddChild(GameObject.Find("UIHUDTextManagerCollection"), hudTextManager);
  2. htManager.GetComponent<UIFollowTarget>().target = transform;
  3. htManager.GetComponent<UIFollowTarget>().uiCamera = GameObject.Find("Camera").GetComponent<Camera>();
  4. htManager.name = recordableObject.globalId;
  5.