HUD Sprites?

Blitz3D Forums/Blitz3D Programming/HUD Sprites?

RustyKristi(Posted 2016) [#1]
I'm trying out some UI stuff and can't seem to find any resource on how to load an image with a certain opacity or some basic setup on creating hud sprites.


Rick Nasher(Posted 2016) [#2]
I'd say check this:
http://www.blitzbasic.com/Community/posts.php?topic=59712
(first 2 links you see in the post)

Those examples should show you enough, especially the sections called "HUD" :-)

I've learned a lot from these examples back in the days.


Rick Nasher(Posted 2016) [#3]
Pretty cool he left them online for so many years. Big tumbs up!


RemiD(Posted 2016) [#4]
With Blitz3d you can use images (made from premade images or with rect/line/plot/text) and draw them after having rendered the 3d scene.
Just make sure that there are not too big and that there is not too many black pixels (which will be transparent). This should be fast enough.


RustyKristi(Posted 2016) [#5]
Thanks RickNasher. I already say j-man's tutorials back when I got started with B3D. The problem is I can't find any reference that points to placing an image/hud with a certain alpha intensity/opacity on his tutorials.

Maybe I'm missing something there I really don't know. :/


RemiD(Posted 2016) [#6]
Oh i did not notice that you wanted a variable transparency/opacity, in this case you could have several premade rectangle meshes (one for each HUD element) with a width/height (in units) which corresponds to the image width/height (in pixels) and when the image is updated, copyrect the result to the texture associated to the rectangle mesh. (or you could draw directly on the texture).
Then you can change the transparency/opacity with entityalpha or brushalpha...

Not sure what you find difficult about this ?

Here is an example to create a rectangle mesh (screen mesh in this case) and position it with pixel precision : http://www.blitzbasic.com/codearcs/codearcs.php?code=3257


RustyKristi(Posted 2016) [#7]
Thanks RemiD, trying out the code I'm getting this error..

Function 'dx7dbf_setsystemproperties' not found



RustyKristi(Posted 2016) [#8]
Ok disregard that previous comment, I think I found the DLL. From my original post, is there a way that I won't have to use any external libs/dlls? I don't mind using it if I also have the sources.

Thanks again RemiD, will try it out.


RustyKristi(Posted 2016) [#9]
The example works but it's too complicated for me to figure this out.

I just need a simple 3d scene with an hud image overlay that you can set the opacity.


RemiD(Posted 2016) [#10]
The code i have linked to is to demonstrate how to create then how to position a quad mesh in the 3d scene with a pixel precision (as if you were positioning an image)
But you have to create your own quad meshes and your own texture depending on what you need, one for each hud element, and define appropriate uv coords so that you can display the textures as if they were images.

The external lib is not needed but if you don't use it, the textures will be slightly blurred (because of bilinear filtering)