Functions
Integrating HUD with Your Framework: Exploring Built-in Functions, Parameters, and Responses.
InitHud(): void
Function to tell the script that HUD can be loaded. Usualy you would want to call as soon as player is loaded.
UpdateStatus(statuses: Object): void
Function used to update the status hud statuses. Should be used inside some kind of thread or your status system's update ticker.
Param
statuses
- Object that keys are name
of status and values are status value.
UpdateInfo(info: Object): void
Function used to update the info hud infos. If you have infos that are static you don't need to pass them everytime you update other dynamic values. Should be used inside thread.
Param
info
- Object that keys are name
of info and values are the info value.
DisplayHud(bool: boolean): void
Function to set HUD display on/off.
Param
bool
- should the hud be displayed.
IsHudDisplayed(): boolean
Function to get current HUD display status.
Response
true/false
CreateNotification(message: string, duration: number, type: NotifType): void
Function to display notification. HUD has built-in notifications system that you can use. This function could be added inside your frameworks CreateNotification
function or simply call it where you want to use it. Also HUD provides events that you can create notification from to make it easier for you to use.
Params
message
- notification message.
duration
- for how long does notification should be shown. In miliseconds.
type
- success
| error
| info
notification type. If you don't specify it, by default it will be info
.
If you try to create multiple notifications with the exact same message when that notifications is still displayed - creation will be ignored.
Notification text color
The notification system has built-in support for changing text color. You can change the entire text color or only specific words using HEX color codes. Everything between <#COLOR_CODE>
and </>
will be rendered in the desired color.
If you pass to `CreateNotification` params message like so:
Notification message will be rendered as "My cool message".
Last updated