RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Ambient SoundUI Apps ManagerUI AudioBindings LegendCamera Distance AppDeveloper ConsoleCredits MusicExternal WebSocket ServerFade ScreenGame BlurGameplay App ContainersGrid SelectorLivery EditorMessages DebuggerMessages/Tasks App ContainersMission InfoPolice InfoTop BarUI ModsNavigation Map DataVehicle Paint EditorVehicle Vicinity AppUI Visibility
Camera ManagementAction Map ManagementEdit Mode State MachineLivery EditorUndo/Redo WrapperLayer ActionsLayer Edit LifecycleLayer DataDecal Texture LoaderLayer SelectionToolsLivery FilesMath Utilities

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 ExtensionsuiliveryEditor

Decal Texture Loader

Loads and categorises decal textures from the dynamic decals texture registry for the UI resource browser.

Loads and categorises decal textures from the dynamic decals texture registry for the UI resource browser.


Overview

ui_liveryEditor_resources reads tagged texture files from editor_api_dynamicDecals_textures, organises them into categories, and provides query functions for the UI's decal picker.

Extension path: lua/ge/extensions/ui/liveryEditor/resources.lua


Dependencies

editor_api_dynamicDecals_textures


Exports (M)

FunctionSignatureDescription
setup()Initialises the textures API and parses all tagged textures into categories.
requestData()Triggers liveryEditor_resources_data with the full texture list.
getTextureCategories() → categories[]Returns all categories sorted alphabetically.
getTexturesByCategory(category) → categoryReturns a single category object by value/name.
getDecalTextures() → textures[]Returns the full categorised texture list.
getCategories() → categoriesReturns raw categories (may be nil).

Data Fields

FieldTypeDescription
M.texturestableCached texture data (initialized as empty {}).

Data Fields

FieldDescription
M.dependencies{"editor_api_dynamicDecals_textures"} - texture management API.

Internals

Texture Category Format

{
  value = "flames",        -- tag name / category id
  label = "flames",        -- display label
  items = {
    {
      name = "flame01.png",
      label = "flame01.png",
      value = "flame01.png",
      preview = "/art/dynamicDecals/flames/flame01.png"
    },
    ...
  }
}

Setup Flow

  1. Calls texturesApi.setup() to initialise the texture file scanner
  2. Gets all tag-to-file mappings via texturesApi.getTagsWithRefs()
  3. Parses into the categorised format above
  4. Scans for untagged textures via texturesApi.getTextureFiles() + readSidecarFile()
  5. Untagged textures go into an "Others" category

Stub Hooks

dynamicDecals_onTextureFileAdded and dynamicDecals_onTextureFileDeleted are defined but empty - reserved for future hot-reload support.


How It Works

  1. On setup(), all decal texture files are scanned and grouped by their sidecar tags
  2. Textures without tags are collected into an "Others" bucket
  3. The UI calls requestData() or getTextureCategories() to populate the decal picker
  4. Categories are sorted alphabetically for consistent display

Example Usage

local resources = extensions.ui_liveryEditor_resources

-- After setup, get all categories
local categories = resources.getTextureCategories()
for _, cat in ipairs(categories) do
  print(cat.label, #cat.items .. " textures")
end

-- Get textures in a specific category
local flames = resources.getTexturesByCategory("flames")

Additional Exports

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

  • M.dynamicDecals_onTextureFileAdded
  • M.dynamicDecals_onTextureFileDeleted
  • M.getCategories
  • M.getDecalTextures
  • M.getTextureCategories
  • M.getTexturesByCategory
  • M.requestData
  • M.setup

See Also

  • Livery Editor - Camera - Related reference
  • Livery Editor - Controls - Related reference
  • Livery Editor - Edit Mode - Related reference
  • UI System Guide - Guide

Layer Data

Manages the UI-side layer data model - parsing, caching, and notifying the UI of layer stack changes.

Layer Selection

Manages the layer selection state - single/multi-select, available actions, highlight toggling, and UI notifications.

On this page

OverviewDependenciesExports (M)Data FieldsData FieldsInternalsTexture Category FormatSetup FlowStub HooksHow It WorksExample UsageAdditional ExportsSee Also