Skip to content

UiAnnouncementOverlay

The UiAnnouncementOverlay class displays temporary announcement messages on the HUD. Announcements are shown for 8 seconds before being automatically removed.

UiAnnouncementOverlay private

Extends UiComponent.

Properties

NameTypeDescription
uiUiCurrent Ui instance. Inherited from UiComponent.
componentElemHTMLElementThe root #hud-announcement-overlay DOM element. Inherited from UiComponent.

Methods

constructor()

ts
function constructor(ui: Ui): void

Initializes the announcement overlay with an empty #hud-announcement-overlay container element.

showAnnouncement()

ts
function showAnnouncement(message: string): void

Creates a new .hud-announcement-message element containing the given message, appends it to the overlay container, and schedules its removal after 8000ms.