Hi!
I’m making a HUD (a.k.a. GUI (the stuff on the GUI node)) for my game. It’s supposed to look something like the World of Warcraft or Dota 2 HUD, with spell icons/buttons, inventories, a chat box, etc.
I have been thinking about how to do animations in the HUD, like:
- Spell cooldown shadows, that look like a pie-chart/clock.
- Blinking/glowing/pulsating effects for, for example, reactive spells (spells that can only be cast after you dodge or something like that), or focused buttons.
- Blinking cursor in a text field.
Spell cooldown shadows.
These are all a little bit different. For example, doing a cooldown clock might be best done by modifying the geometry (I dunno); while blinking, or pulsating, especially with different colors, might be best done by modifying the material. And for the blinking cursor, just adding and removing a child quad might be best.
I have so far tried to avoid mutation in my HUD as much as possible. Every time I move an item in the inventory, for example, I just remake the tree of components that make up the inventory. This is of course a lot simpler than mutating, because I just need one function that creates the tree given some input, and no additional functions that modifies the tree. I would like to keep just generating the HUD from input data, as much as possible.
For example, I could make the spell cooldown shadows a mesh with an animation that I start at some particular speed, and it would finish just in time. But say that some other spell modifies the cooldown of the spell, then suddenly it becomes more complicated to make the animation work. But if I just generate the HUD from input, I would not have to care one bit about changing anything about the cooldown, it would just work.
I’m kind of new to all this. I have not done much with JME yet. I have a few general questions:
How would you make the three examples (cooldown, blinking, cursor) work?
How would you update the effects, if they need updating (like the blinking cursor)?
Is it feasible to remake parts of the HUD every frame?
Any other general ideas, comments or tips regarding making a HUD like this?