Make billboard always face screen

There are no stupid questions, just stupid answers.
5 posts Page 1 of 1
Tiel
Posts: 25
Joined: Tue Mar 01, 2016 11:39 pm
by Tiel » Thu Oct 06, 2016 1:09 am
I'm looking for a way to have a billboard always face the screen, not just the camera position in the world.

This is to put a kind of 3D text above certain objects-kinda like waypoints but editable (is there a term for this?). What I have now works well enough, just not supergood with the BBs presenting themselves at an angle to adjust to the camera.

I think the only alternative would be to have hidden textctrls on playgui and schedule them to update when a special object is in view, though that seems less than ideal.

Greatly appreciate any input here
Duion
Posts: 1636
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Thu Oct 06, 2016 9:29 am
That is what shapenames are for, they are enabled by default for player objects, but they just have regular text, not 3D text.
Tiel
Posts: 25
Joined: Tue Mar 01, 2016 11:39 pm
by Tiel » Thu Oct 06, 2016 12:33 pm
Thanks for your thoughts,

I was never able to get shapenameHUD working, it's reluctant to function when set up like so
Image

What I'm working with is
Image

I'm not certain it's possible to get similar results with shapeNameHUD - also there's a lot going on in the gamespace and not sure how to make the control discriminate objects.
kent
Posts: 35
Joined: Sun Sep 04, 2016 11:54 pm
by kent » Sat Oct 08, 2016 9:20 pm
I think the ShapeNameHud should basically do what you want. The control already walks the client object list, culls obstructed objects, positions text in relation to the object in 2d gui space, then scales the size and performs a fade-out based on distance.

At worst it would take some minor tweaking of the gui's C code to get it the way you want it. For example, the text does not currently rotate to match the object.

To get any shapeBase-derived object (pretty much everything with a 3d model) to display a name, the object must be assigned a shapeName using Object.setShapeName("name").

The full template will set the shapeName automatically for players - based on player name sent when connecting to the server (which defaults to "visitor"). It also sets the field for vehicles/turrets - based on a field "nameTag" defined in a vehicle/turret's datablock. At least in the 3.8 template ... I haven't played with the 3.9 one yet.

If those routines are bypassed or the name-popup functionality is desired for additional object types, it is necessary to call the setShapeName() function on the objects when they are added in script.
Duion
Posts: 1636
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Sun Oct 09, 2016 3:30 pm
I would just go with what is already there and extend it later eventually, if you want to customize everything from the beginning you will just waste time on unimportant visual extra features instead on spending time developing the core game.
5 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests