CreateHudSynchronizer Function

Creates a HUD synchronization object. This object is used to automatically assign and re-use channels for a set of messages.

The HUD has a hardcoded number of channels (usually 6) for displaying text. You can use any channel for any area of the screen. Text on different channels can overlap, but text on the same channel will erase the old text first. This overlapping and overwriting gets problematic.

A HUD synchronization object automatically selects channels for you based on the following heuristics: - If channel X was last used by the object, and hasn't been modified again, channel X gets re-used. - Otherwise, a new channel is chosen based on the least-recently-used channel.

This ensures that if you display text on a sync object, that the previous text displayed on it will always be cleared first. This is because your new text will either overwrite the old text on the same channel, or because another channel has already erased your text.

Note that messages can still overlap if they are on different synchronization objects, or they are displayed to manual channels.

These are particularly useful for displaying repeating or refreshing HUD text, in addition to displaying multiple message sets in one area of the screen (for example, center-say messages that may pop up randomly that you don't want to overlap each other).

Handle CreateHudSynchronizer()

Return Value

New HUD synchronization object. The Handle can be closed with CloseHandle(). If HUD text is not supported on this mod, then INVALID_HANDLE is returned.