On-screen notifications: short messages that slide in at the top right corner of the screen. Flux.Notification:add queues a message, either plain text or a language phrase. Queued messages are displayed one after another as fl_notification panels, each one pushing the older ones down, and disappear after their lifetime. Flux.Notification:add_popup creates a single notification at a given position instead. On the client Player:notify displays its message through this library; server code sends notifications with Player:notify or Flux.Player:notify.

Summary

Methods

Queues a notification to be displayed in the top right corner of the screen.
Immediately creates a notification at the specified position, bypassing the queue.
Displays the next queued notification in the top right corner of the screen and pushes the older ones down.
Moves all of the displayed notifications down to make room for a new one.

Methods

Flux.Notification:add(text, lifetime, text_color, back_color)

client packages/active_ui/lib/cl_notifications.lua:58

Queues a notification to be displayed in the top right corner of the screen.

Parameters

  • text String text or language phrase
  • lifetime Number optional, defaults to 8 how long to display it for, in seconds
  • text_color Color optional, defaults to Color(255, 255, 255)
  • back_color Color optional, defaults to Color(0, 0, 0)

Flux.Notification:add_popup(text, lifetime, x, y, text_color, back_color)

client packages/active_ui/lib/cl_notifications.lua:71

Immediately creates a notification at the specified position, bypassing the queue. The text is displayed as is, without being translated.

Parameters

  • text String
  • lifetime Number how long to display it for, in seconds
  • x Number
  • y Number
  • text_color Color optional, defaults to Color(255, 255, 255)
  • back_color Color optional, defaults to Color(0, 0, 0)

Flux.Notification:process_queue()

client packages/active_ui/lib/cl_notifications.lua:17

Displays the next queued notification in the top right corner of the screen and pushes the older ones down. Does nothing while another notification is still sliding in.

Flux.Notification:reposition(offset)

client packages/active_ui/lib/cl_notifications.lua:87

Moves all of the displayed notifications down to make room for a new one.

Parameters

  • offset Number height of the new notification in pixels

Defined in