Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Making Huds Transparent?

Author
Message
wickedly kick it
18
Years of Service
User Offline
Joined: 13th Jul 2006
Location: Fort-worth Texas
Posted: 14th Oct 2007 19:48
i should know this but i never worked with huds before. So would i make a image for each component for the hud, or could i somehow make one and make all the black transparent? thanks for any help
(btw, i am just making a panel at the bottom and a few switches at the top and a giant crosshair down the middle)

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 14th Oct 2007 20:23
You should make each part separately, otherwise you are forcing your program to draw a lot of "nothing" every frame.

Make the graphics in Png format with transparent background. This allows you to feather (blend) the edges, and also make different parts of the graphic different levels of transparency. For example, you can make the HUD panel semi-transparent, with the game showing through.

hyrichter
20
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 14th Oct 2007 20:39
A really simple way to do it would be to just paste your HUD image onto a plane, and then just ghost it.

CodeSurge
Version 1.0 finally released! Code your DBP projects in style. (And save the kittens!)
calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 14th Oct 2007 21:27
Or use sprites, colorkey and alpha-blending.

I can't be bothered to invent a signature
wickedly kick it
18
Years of Service
User Offline
Joined: 13th Jul 2006
Location: Fort-worth Texas
Posted: 14th Oct 2007 21:42
i figured it out,
set object transparency 1,6

HeavyAmp
17
Years of Service
User Offline
Joined: 25th Oct 2006
Location: Castle in the Sky!
Posted: 15th Oct 2007 03:27
I have written up an example. I was watching my bro play a game that had transparent windows the other day and I thought that would be cool to make. When I read your post I thought I would give it a go.



Better to be dead, than to live your life afraid.
JerBil
20
Years of Service
User Offline
Joined: 8th May 2004
Location: Somewhere along the Z axis...
Posted: 22nd Oct 2007 21:52
Very nice, HeavyAmp. You don't have to use cls with sync, btw.

Ad Astra Per Asper
HeavyAmp
17
Years of Service
User Offline
Joined: 25th Oct 2006
Location: Castle in the Sky!
Posted: 24th Oct 2007 03:32
Thanks JerBil.

Better to be dead, than to live your life afraid.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 30th Oct 2007 02:53
@BatVink -
Quote: "Make the graphics in Png format with transparent background. This allows you to feather (blend) the edges"
What is feathering?

I've heard in other boards that sprites might be a more effective way to go with regards to frame rates - I even heard a suggestion that was made after that one - to use the "Sprite add on" that is out and about somewhere in here - was in the last issue of TGC mag I think - note these suggestions were all geared toward achieving maximum frame rates and still getting the desired effect.

The alpha plain idea etc were all shot down - I have not done this just passing the wealth on.

what I have noticed about alpha plains I have used is that it MATTERS which one you create first - as to how well it looks when another plain that is also "alpha'd" see though goes infront or beghind another.... One way looks great - the other way - blocks out the one behind it. Very noticable on my apche "rotors" - from one point of view - the tail rotor and main rotor - both see thorugh (its a blur thing) get darker where they overlap - from another camera angle - it looks - well - STUPID.


Just keep this in mind when doing the hud - if you decide to use plains (or sprites) and get "STUPID" results, try changing the order in which they are loaded or presented - (which is in front of which)

Just a thought or two.

Login to post a reply

Server time is: 2024-09-27 08:34:45
Your offset time is: 2024-09-27 08:34:45