As in title, How should I implement a HUD?
Or, better, how is it better to do? Put everything on a layer? In every scene?
I’m a bit confused by the external layouts. The name sounds somewhat cool for a HUD, doesn’t it?
As in title, How should I implement a HUD?
Or, better, how is it better to do? Put everything on a layer? In every scene?
I’m a bit confused by the external layouts. The name sounds somewhat cool for a HUD, doesn’t it?
What kind of game are you making? What will be on the HUD?
Although whatever your answers to the above questions are, yes your HUD should be in an external event.
External layouts… external events…
External layout are useful for make different levels (different layouts/setup of objects) from a main scene and its events (you create the scene, with the control events, physics and everything working nicely and then create different external layouts re-ordering the platforms, adding enemies, etc.)
External events works as external code, you can attach the external code anywhere in the scene events and it will be executed as is it were in the scene code.
A HUD is allways in the same position in front of the camera, so put it in a new layer will be useful
As Mats says, we don’t know what kind of HUD you are looking for, but typicaly they are:
-Objects resized with a simple rule of three.
or -Drawer objects with a draw size calculated with the same rule of three.
EDIT: Ohhh, HUD hehe… I understood something else, anyway it should be easy
The game i’m planning is a graphical adventure (for which I also asked this: viewtopic.php?f=19&t=5294)
on the HUD should be only a few buttons, and a collapsable inventory.
As far as i understand, i should make a few scene with some charachters and then point to them as needed from external layouts. Using the scenes as “template pages” that contain charachters, objects, backgrounds…
You can place the game pieces as you want/like
The HUD (as I sayd before) should be in a top layer.
Then, in the game events (if the click works for something else), you should check first if the game click a button HUD:
Left click is pressed | Do = 1 the variable "game click?"
Mouse is over Button(HUD) | Do actions related to this button
| Do = 0 the variable "game click?"
The variable "game click?" = 1 | Do actions related to in-game click
So, if you click a HUD button you will not (for example) shoot.
Thank you, that’s clear.
I’ll open another thread for clearing up the scene vs ext-scene matter. As I said i’m after a graphical adventure, so probably the logic behind a platformer or shooter game won’t apply