RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

server/commands - Camera & Input Commandsge_utils - Game Engine Utility Functionsmain.lua - GE Lua Entry Point & Game Loopmap.lua - Navigation Graph (AI Road Map)screenshot.lua - Screenshot Systemserver/server - Level Loading & Game ServerserverConnection - Client-Server Connection Manager`setSpawnpoint` - Default Spawn Point Persistence`simTimeAuthority` - Simulation Time & Bullet Time Control`spawn` - Vehicle Spawning & Safe Placement`suspensionFrequencyTester` - Suspension Natural Frequency Analysis
ui/ambientSound - Ambient Sound Stream PlayerUI Apps ManagerUI AudioBindings LegendCamera Distance AppConsole (consoleNG)Credits MusicExternal App (WebSocket UI Server)Fade ScreenGame BlurGameplay App ContainersGrid SelectorLivery EditorMessages DebuggerMessages/Tasks App ContainersMission InfoPolice InfoTop BarUI ModsUI Navigation / MapVehicle Paint EditorVehicle Vicinity AppUI Visibility

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE Extensionsui

Gameplay App Containers

Manages visibility of in-game HUD apps (rally, drift, drag, countdown, flash messages) and a queued flash message system.

Manages visibility of in-game HUD apps (rally, drift, drag, countdown, flash messages) and a queued flash message system.


Overview

ui_gameplayAppContainers controls which gameplay HUD apps are visible during gameplay. It provides a container-based visibility system and a FIFO flash message queue with timer-based display cycling.

Extension path: lua/ge/extensions/ui/gameplayAppContainers.lua


Exports (M)

FunctionSignatureDescription
setAppVisibility(containerId, appId, visible)Set visibility of a specific app.
getAppVisibility(containerId, appId)Returns visibility boolean for an app.
showApp(containerId, appId)Show an app.
hideApp(containerId, appId)Hide an app.
toggleApp(containerId, appId)Toggle an app's visibility.
hideAllApps(containerId)Hide all apps in a container.
getVisibleApps(containerId)Returns list of visible app IDs.
getAvailableApps(containerId)Returns all apps in a container.
clearAllFlashMessages()Clears flash message queue and hides app.
clearMessagesFromSource(source)Clears queued/current messages from a specific source.
setDebug(enabled)Toggles ImGui debug window.
setVerboseLogging(enabled)Toggles verbose logging.
getGameplayAppContainerMounted()Returns true if the UI component is mounted.

Legacy API (Deprecated)

FunctionReplacement
setContainerContextsetAppVisibility
getContainerContextgetVisibleApps
resetContainerContexthideAllApps
onExtensionLoaded()
onExtensionUnloaded()
onScenarioFlashMessage(...)
onScenarioFlashMessageClear(...)
onScenarioNotRunning()
onGameplayAppContainerMounted(containerId)
onGameplayAppContainerUnmounted(containerId)
onSerialize()
onDeserialize(data)

Data Fields

FieldDescription
M.getAvailableContextsAlias for getAvailableApps - redirected for backwards compatibility.

Internals

Container Structure

The default container gameplayApps contains six apps:

local appContainersById = {
  ['gameplayApps'] = {
    apps = {
      rally = { visible = false },
      drift = { visible = false },
      drag = { visible = false },
      pointsBar = { visible = false },
      flashMessage = { visible = false },
      countdown = { visible = false },
    },
    trigger = 'setGameplayAppVisibility',
  }
}

Visibility changes trigger guihooks.trigger("setGameplayAppVisibility", ...) to update the UI.

Flash Message Queue

Messages are queued with a 50-message limit. Each message has a source, duration, and timer:

-- Messages routed from drift/drag sources
ui_gameplayAppContainers.onGameplayFlashMessage({
  source = 'drift',
  data = {{'Drift Combo x5!', 3.0, 0, false}}
})

The onUpdate callback processes the queue using dtSim accumulation - messages pause when the simulation is paused.

Countdown Auto-Hide

When scenario countdown messages are detected (ui.scenarios.go), the countdown app is shown and auto-hidden after the "Go" message TTL expires.


How It Works

  1. Gameplay systems call showApp("gameplayApps", "drift") to activate HUD elements
  2. Flash messages are queued via onGameplayFlashMessage and displayed one at a time
  3. onUpdate advances message timers, cycling to the next message when duration expires
  4. hideAllApps resets everything when a scenario ends or mode changes
  5. State is serialized/deserialized for session persistence

Additional Exports

The following exports are available but not yet documented in detail:

  • M._countdownHideTimer
  • M.clearAllFlashMessages
  • M.clearMessagesFromSource
  • M.getAppVisibility
  • M.getAvailableApps
  • M.getContainerContext
  • M.getGameplayAppContainerMounted
  • M.getVisibleApps
  • M.hideAllApps
  • M.hideApp
  • M.onDeserialize
  • M.onExtensionLoaded
  • M.onExtensionUnloaded
  • M.onGameplayAppContainerMounted
  • M.onGameplayAppContainerUnmounted
  • M.onGameplayFlashMessage
  • M.onScenarioFlashMessage
  • M.onScenarioFlashMessageClear
  • M.onScenarioNotRunning
  • M.onSerialize
  • M.onUpdate
  • M.resetContainerContext
  • M.setAppVisibility
  • M.setContainerContext
  • M.setDebug
  • M.setVerboseLogging
  • M.showApp
  • M.toggleApp

Game Blur

Screen blur rectangle system - manages groups of blur regions rendered each frame via the `ScreenBlurFX` post-effect.

Grid Selector

Facade module that routes all grid selector API calls to the appropriate backend (vehicle, gameplay, app, freeroam).

On this page

OverviewExports (M)Legacy API (Deprecated)Data FieldsInternalsContainer StructureFlash Message QueueCountdown Auto-HideHow It WorksAdditional Exports