Best way of adding custom hud elements?

Status
Not open for further replies.
The best hook?

The HUD hooks and the, well, normal hooks are vastly different.

The normal hooks are used for manipulating the game, be it setting variables, moving objects from here to there, and -you name it-.
The HUD hooks, on the other hand, were designed for hooking onto the game's display, and have their own dedicated functions for drawing patches, strings of text, numbers, etcetera. It runs clientside, so you should avoid setting important player variables or manipulating objects this way.

You can hook to the HUD via hud.add(function func, string hook).
Here's the relevant information: https://wiki.srb2.org/wiki/Lua/Functions#HUD_library
 
Last edited:
The best hook?

The HUD hooks and the, well, normal hooks are vastly different.

The normal hooks are used for manipulating the game, be it setting variables, moving objects from here to there, and -you name it-.
The HUD hooks, on the other hand, were designed for hooking onto the game's display, and have their own dedicated functions for drawing patches, strings of text, numbers, etcetera. It runs clientside, so you should avoid setting important player variables or manipulating objects this way.

You can hook to the HUD via hud.add(function func, string hook).
Here's the relevant information: https://wiki.srb2.org/wiki/Lua/Functions#HUD_library

i managed it from looking at other scripts since i learn easily that way as well, i got the result as well
unknown.png
 
Last edited:
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top