Flux.Notification classclient
Part of Active UI
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
Methods
Flux.Notification:add(text, lifetime, text_color, back_color)
client packages/active_ui/lib/cl_notifications.lua:58Queues 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
8how 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:71Immediately 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)
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.
Moves all of the displayed notifications down to make room for a new one.
Parameters
- offset Number height of the new notification in pixels