A notification popup (fl_notification): lines of text on a rounded card with an accent stripe, over a blurred background, that fade in and out. Set it up with set_text, set_text_color and set_background_color, and call set_lifetime to start the timers that slide it off the right edge of the screen and remove it. Notifications are normally created through Flux.Notification:add, which also queues and positions them. A theme can take over the drawing with its PaintNotificationContainer and PaintNotificationText hooks.

Summary

Methods

Returns the color of the stripe and the tint of the card: the background color that was set, or the accent color of the theme.
Returns the color of the text: the one that was set, or the text color of the theme.
Init()client
Sets up the fade state and a placeholder text.
Draws the blurred card with its accent stripe and the text lines, unless the theme's PaintNotificationContainer or PaintNotificationText hooks return a truthy value.
Sets the color of the stripe of the notification.
Sets how long the notification stays up.
Sets the notification text and resizes the panel to fit it.
Sets the color of the notification text.
Resizes the panel to fit every line of the notification text.
Think()client
Fades the notification in after it is created and out shortly before its lifetime ends, then calls PostThink if the panel defines it.

Methods

Returns the color of the stripe and the tint of the card: the background color that was set, or the accent color of the theme.

Returns

  • Color

Returns the color of the text: the one that was set, or the text color of the theme.

Returns

  • Color

Sets up the fade state and a placeholder text.

PANEL:Paint(width, height)

client packages/active_ui/views/base/cl_notification.lua:81

Draws the blurred card with its accent stripe and the text lines, unless the theme's PaintNotificationContainer or PaintNotificationText hooks return a truthy value.

Parameters

  • width Number panel width
  • height Number panel height

PANEL:set_background_color(col)

client packages/active_ui/views/base/cl_notification.lua:132

Sets the color of the stripe of the notification.

Parameters

  • col Color optional, defaults to nil the accent color of the theme when omitted

Sets how long the notification stays up. Starts timers that slide it off the right edge of the screen 1.5 seconds before the end and remove it once the time is up.

Parameters

  • time Number lifetime in seconds

Sets the notification text and resizes the panel to fit it. Newline characters split the text into separate lines.

Parameters

  • text String

Sets the color of the notification text.

Parameters

  • col Color optional, defaults to nil the text color of the theme when omitted

Resizes the panel to fit every line of the notification text.

Fades the notification in after it is created and out shortly before its lifetime ends, then calls PostThink if the panel defines it.

Defined in