Dynamic or Static HUD?

You guys get a sneak peak at my lighting and effects stunted screenshot of Galaxies Beyond because I need some help figuring out the best way to display the graphical aspects of my HUD.  The “half-circle thingy” on the left side is sort of a progress bar that displays how fast you’re going in comparison to the maximum speed the ship will fly and I am currently just displaying an image there but was wondering if it would be easier to manipulate clipping an image or perhaps should I consider drawing it directly with OpenGL instead?

Anyone that has any previous experience or ideas are welcome.

Nice screenshots…

For my HUD I draw everything with Java2D, and it works fine, with transparency and everything. But this is probably not the fastest way, if you have to update it more often…

Fast is the most important thing to me since this is part of the game process itself and I can't afford to slow it down any for the HUD.

The arrows labelled 'Shield Integrity' and 'Hull Integrity' appear to be pointing to nothing.

Am I just going blind?!  :?

Gentleman Hal said:

The arrows labelled 'Shield Integrity' and 'Hull Integrity' appear to be pointing to nothing.

Am I just going blind?!  :?

yes you're going blind

They're a little too translucent. :o

actually they're quite visible to me  :expressionless:

If I highlight the image I can see them.

I can also see the stars and planet!  Without highlighting all I can see is a plain black background and a small semi circle of the planet in dark red behind the speed gauge  :expressionless:

then you either have to adjust your monitor settings or consult an ophthalmologist. if it's your monitor and you don't adjust it, you'll have to consult that ophthalmologist sooner than you think.

not joking.

Yeah tell me about it  :expressionless:

It's my work monitor, auto adjust has set it like this.  I just tried to manually adjust and even with brightness and contrast both at 100 I still can't see the gauges  :frowning:

Fortunately in the game you'll be able to set the alpha on the HUD. :wink:

How about we get back to my question though…thread hijacking is not allowed on threads that I actually need info on.  :stuck_out_tongue:

I thought about this a little for my game, and I think I have a way of doing it fairly simply just by altering UV coords. Say if you wanted a semicircular arc that fills up from empty (invisible) to a full half circle. You set up a quad that never moves, then you texture it with an image that is a half circle centered on the center of the image. The UV map always puts the center of the texture on the middle of the right hand edge of the quad. Then you just spin the UV mapping around that center to move the texturing onto the quad, to display either the empty half of the texture, or the filled in half, or somewhere in between. You can do different angles by angling the quad to set the "bottom" of the gauge and changing the maximum texture rotation to change the top end of the gauge. The quad "clips" the gauge texture by making sure that you can only see the part of the rotating texture that is actually on the quad. Should work for linear gauges as well just by moving the texture. I don't think it wold work for gauges that tracel round more than 180 degrees, maybe for that you would use two separate quads next to each other, one to display each 180 degree slice.

I think that would work… but I haven't actually tried it yet :slight_smile:

hehe, thanks for the info…I'll let you know if we successfully make that work. :wink:

I thought I'd give it a go… works well :slight_smile:

The code is in Gauge180 in aircarrier, or just run CarrierSimpleLevelManagers to see it displaying plane speed. Needs a few tweaks to make it slightly easier to use (positioning and which direction it displays in, etc.)

I started working out my own gauge since Shingoki’s wouldn’t quite work how I wanted.  However, I’m stuck with a problem.  I created a clipping texture in black that I’d like not to display outside of my node.

I have a Node with two Quads (my texture and my clipping (black) texture).  I would like the Node to render hiding the black making it transparent, but instead this is what I get:

Is what I'm trying to do possible or am I losing it again? :o

Why don't you use 1 quad with multi-texturing?  One of the COMBINE setups should do what you are looking to accomplish.

can't really help with the HUD darkfrog, but the screenshot looks a bit "wrong". if you draw a line from the crosshair to the outer margin of the gauge, the line won't be parallel with the gauge "fill". i hope you understand what i mean.

Well, it is apart from the "top" and "bottom" of the gauge because I clipped them non-uniformly.

I found a way of taking screenshots that shows how my gauge works… so at least it’s clear what it does, even if it doesn’t do what you wanted :wink: For my game it works quite well :wink:

Gauge showing low:

You can see the outline of the alpha textured quad used to draw the gauge, since for some reason it stops the bounding boxes being drawn behind it :slight_smile: So you can see that the top edge of the quad (the one that passes through the center of the screen) sets the “top” of the gauge, and the bottom of the gauge is where the texture stops at the bottom.

As the gauge fills up, the quad rotates to move the top of the arc higher, and the texture stays “pinned” in place. (Although this actually requires that the texture rotates backwards to cancel out the quad rotation):

The gauge as shown is set to start at about “7 o’clock” and end at “11 o’clock”.

The other gauge mode doesn’t “pin” the texture, so the texture rotates as the gauge fills, but this is just a matter of changing a boolean. Other effects are possible by altering the mapping of gauge level to quad and texture rotation (I know that because I ran into a LOT of random incorrect mappings as I was writing the code :slight_smile:

I think the other way of doing the effect is to use clipping planes, which should work fine as well and avoids some trigonometry. But I didn’t think of that before I wrote this code :wink: I’m not sure whether it is more or less efficient overall.