Tasharen Entertainment Forum
Support => Other Packages => Topic started by: sahyun1 on December 05, 2013, 05:36:14 AM
-
Hi guys
I'm making 2D game with new Unity 4.3
I've bought NGUI:HUD text and it works great I really like it. But I would like a some sort of box around HUD text, something like a speech bubble.
How can I achieve this?
My initial thought is to use srpite renderer on the gameObject above the player's head and display the text but this would be very difficult to set the size of bubble as it would be a static
I'm sure there's some more elegant way, any thoughts will be helpful!
thanks
-
That's a good idea actually. I'll see about making an example of that after this weekend's release of NGUI 3.0.7.
-
Thank you, that would be great!
Hope to see your example soon :)
-
i actually made this awhile back before i upgraded to 3.07 but now the localscale variable doesnt work so i am having to rewrite the parts that scale the bubble to the text width per line. once i finish i can post it.
-
No need to write code. Set the anchor on your sliced sprite to be the label, and give it some padding. It will scale automatically to envelop the content.
-
Thank you for help guys, but I'm completely new to Unity, would you be able to elaborate little bit more??
-
I can't elaborate it further than that, unfortunately. All I can suggest is watch the tutorial videos that come with NGUI:
http://www.tasharen.com/forum/index.php?topic=6754.0
This one explains the layout system and how to use it: http://www.youtube.com/watch?v=P8JTTE0JBXQ
The latest HUDText does exactly this for the description label anchored to the bottom. Try it -- open one of the examples and change the text on the bottom. The background will resize to match.
-
Hi there
I just updated NGUI HUD text, as stated in readme 1.9, I delete the example folder and script folder, and use hudtext_ngui270.unitypackage.
Now, I have readme 1.6, is this correct? is my NGUI HUD text asset properly updated?
-
I'm asking this because even I change the text on bottom, the surrounding box does not shrink
-
hudtext_ngui270.unitypackage is the old version of HUDText for those who are not using NGUI 3.
Why are you importing it? Don't do it. When you import HUDText you already have the latest version. Don't import the outdated package.
-
Hi
That's because I only purchased NGUI HUD text, not the whole package, so using distributed one, version 2.7.
It says use hudtext_ngui270.unitypackage if I have NGUI 2.7 or earlier
-
Ok, well you haven't mentioned that before. My advice was for the latest version of NGUI. 2.7.0 isn't supported anymore, which is why it's unofficially free. Without NGUI 3, you can achieve the same effect by making the background a child of your label, then putting UIStretch on it and targeting the label as the container so that it stretches the background to envelop it.
But as I said... 2.7.0 is not supported anymore.