Jump to content

Display Text and Numbers on HUD


UbiquitousStudio
 Share

You are about to reply to a thread that has been inactive for 1287 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello, I have been looking through some different ways of trying to display text and numbers on a HUD. I can't find much information on this.

Say I have a integer I want to display in numbers and have the numbers change accordingly.

Would I make numbers 1-9 in textures and change them on specific faces according to the integer changing, or is this a easier more efficient way of doing this.

Thanks

Link to comment
Share on other sites

You have two basic options.  You can use texture switching or you can use hover text. 

Texture switching works best if you simply make up a single texture with whatever characters you need displayed in regular rows and columns.  Then rescale the image in your script and use texture offsets to display individual characters.  That means displaying one character per face on your HUD -- easily done if you build your HUD out of 8-material mesh subunits.

If you use hover text, the trick is to rotate your display prim(s) so that the Z axis points straight out of the screen toward you.  Any hover text that you display will therefore be centered directly "above" the prim and this right in the middle as you look at it.  See https://community.secondlife.com/t5/LSL-Scripting/dialogger-an-alternative-to-llDialog/m-p/981569 , for example

I've used variations on both methods,  Hover text is better if you have long text to display.  Texture switching is better if you want to control the font and size of your text.

  • Like 2
Link to comment
Share on other sites

The way to place hover text is not exactly like you say

You see hover text placed over the center of the prim no matter how you turn and move the prim

How much the text is over the center is determined by the prim's Z dimension

So in a hud with the Z axis perpendicular to the screen you can change the text position by changing Z dimension without any visible change in size of the hud

:smileysurprised::):smileyvery-happy:

  • Like 1
Link to comment
Share on other sites

I see I was having this problem when actually trying it now. I set the text and rotate and the text does not actually rotate.

So I am now trying to understand what you mean, I don't know what you mean by the Z dimension mostly. I use firestorm and can't seem to find a dimension option and the position, size, and rotation don't change it.

Here is a image

https://gyazo.com/9614a1b5b2818d72eddf0f7db669e085

Link to comment
Share on other sites

Okay so my original issue is I was trying to edit the hud while it was on my screen and that doesn't give a local option. But even in local or world with editing the object on the ground it still just not doing anything different and I really don't get the concept behind what is actually being done at all. I have been basically standing here spinning and resizing a box and a text over it for a long time now.

Thanks for your time.

Link to comment
Share on other sites

  • 3 years later...
On 6/3/2016 at 6:55 PM, Rolig Loon said:

Texture switching works best if you simply make up a single texture with whatever characters you need displayed in regular rows and columns.  Then rescale the image in your script and use texture offsets to display individual characters.  That means displaying one character per face on your HUD -- easily done if you build your HUD out of 8-material mesh subunits.

Replying to an old thread here!

I’m building a texture-based character display. Yes there are lots on the MP but I want my own ‘look’ and font.

Making a grid of characters is fine (I’m used to working with CSS sprites in web development) but I’m curious about what you mean here by “8-material mesh subunits”.

Could you possibly link me to any material on getting started with this? 

I’m stronger on the coding side than on the mesh / Blender / UV-mapping side of things. Basically I know how to apply a texture to a face using the IW tools. And I have some basic experience with converting prims to mesh.

Many thanks!

Link to comment
Share on other sites

3 hours ago, lostware said:

curious about what you mean here by “8-material mesh subunits”.

You'd start with something like this to make something kinda like this. There are textures that consist of letter pairs, making it practical to put two characters on a face - so 16 on one of these 8-material meshes - but font quality and texture loading times are compromised compared to the single character per face font textures. If you wanted the units to show you as creator, you'd need to upload that mesh yourself, and it's a pretty easy start for learning Blender, introducing "materials" (sides, when uploaded) and simple UV-mapping.

  • Like 1
Link to comment
Share on other sites

It's interesting how rapidly I can adopt a new way of doing things and totally forget the older way. Within a year after I made that post quoted above, I stumbled on a new free commercial package that takes that basic idea and really runs with it.  Take a look at FURWARE's open source FURWARE Text 2.0.1 in Marketplace.  You don't have to create your own mesh units or do the scripting necessary to get letters to show up in the right places. 

  • Like 2
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1287 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...