Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: omira on April 29, 2012, 11:37:47 AM

Title: Hud system
Post by: omira on April 29, 2012, 11:37:47 AM
ok, i'm trying to create a HUD system like the on this picture: http://imageshack.us/photo/my-images/36/exampleqv.jpg/ (http://imageshack.us/photo/my-images/36/exampleqv.jpg/) it's a floating box around the selected item + info's, i have no idea how to start :D
Title: Re: Hud system
Post by: Sarus on April 30, 2012, 06:59:25 AM
Read this thread: http://www.tasharen.com/?topic=creating-a-ui-sprite-on-the-fly

ArenMook was nice enough to also provide a download of the sample project so you can see how it works (making a healthbar float over the characters heads)

You can download the sample project here:

http://www.tasharen.com/ngui/gt.unitypackage

Title: Re: Hud system
Post by: omira on May 01, 2012, 11:23:11 AM
thx for the examples, great help for me :) but one problem is still left for me: placing labels/sprites in the middle obove/under a opject is no problem, but how do i get/calculate the coordinates of a corner from a object? any ideas?

sry for my bad english :(
Title: Re: Hud system
Post by: ArenMook on May 01, 2012, 11:34:56 AM
That's a math question, not a UI question :P

You'll need to calculate the bounds of the object and using that -- calculate the corners in a way that makes them always face the camera. It just involves a lot of math.
Title: Re: Hud system
Post by: omira on May 02, 2012, 02:55:28 AM
It just involves a lot of math.

Hard way, but i got it :P

thx for the hints

thats my result: http://imageshack.us/photo/my-images/137/hudtest.jpg/ (http://imageshack.us/photo/my-images/137/hudtest.jpg/)