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
Decal CursorDecal OperationsDecal LayersFill LayersGroup Layers

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 ExtensionsuiliveryEditorlayers

Decal Layers

Operates on existing decal layers - transform (scale, skew, rotate), material properties (colour, metallic, roughness), and data formatting.

Operates on existing decal layers - transform (scale, skew, rotate), material properties (colour, metallic, roughness), and data formatting.


Overview

ui_liveryEditor_layers_decals provides the per-layer editing operations that modify an already-placed decal. Unlike the cursor module (which controls the preview), this module writes directly to layer objects via api.setLayer().

Extension path: lua/ge/extensions/ui/liveryEditor/layers/decals.lua


Exports (M)

FunctionSignatureDescription
setLayer(layerUid)Sets the active layer and stores a deep copy.
addLayer(params) → layerAdds a new decal using cursor mode at (0.5, 0.5).
setColor(layer, color)Sets RGBA colour on a layer.
setMetallicIntensity(layer, value)Sets metallic intensity on a layer.
setRoughnessIntensity(layer, value)Sets roughness intensity on a layer.
rotate(layer, degrees, ccw)Rotates a layer by incremental degrees.
setRotation(layer, degrees)Sets absolute rotation in degrees.
scale(layer, steps_x, steps_y)Scales a layer by step increments.
setScale(layer, scaleX, scaleY)Sets absolute scale.
skew(layer, stepsX, stepsY)Skews a layer by step increments.
setSkew(layer, skewX, skewY)Sets absolute skew.
setMirrored(layer, mirrored, flipped)Sets mirror and flip flags.
setDecal(layer, texture)Changes the decal texture path.
getData(layer) → tableReturns UI-formatted data for the layer.
getLayerActions() → string[]Returns available actions: transform, material, order, duplicate, mirror, rename, visibility, delete.
requestData / notifyListeners(layer)Triggers LiveryEditor_CursorUpdated with the layer's data.

Data Fields

FieldDescription
M.layerDatanil - cached data for the currently active decal layer.

Internals

Step Units

ROTATE_STEP_UNIT = 0.1
SCALE_STEP_UNIT  = 0.01
SKEW_STEP_UNIT   = 0.01

getData Format

Returns the same shape as the cursor's getData() but with applied = true, indicating the data reflects a placed layer rather than the cursor preview.

Notify Pattern

Every setter calls api.setLayer(layer, true) (true = re-render) then triggers LiveryEditor_CursorUpdated so the UI stays in sync.


How It Works

  1. setLayer(uid) caches the layer data for potential restore
  2. Transform functions modify layer.decalScale / decalSkew / decalRotation directly
  3. Material functions modify layer.color / metallicIntensity / roughnessIntensity
  4. After each change, api.setLayer(layer, true) commits and re-renders
  5. notifyListeners(layer) pushes updated data to the UI

Example Usage

local decals = extensions.ui_liveryEditor_layers_decals
local api = extensions.editor_api_dynamicDecals

local layer = api.getLayerByUid(someUid)
decals.setColor(layer, {1, 0, 0, 1})       -- red
decals.setScale(layer, 0.3, 0.3)
decals.setRotation(layer, 45)
decals.setMirrored(layer, true, false)

Additional Exports

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

  • M.addLayer
  • M.getData
  • M.getLayerActions
  • M.layerUid
  • M.notifyListeners
  • M.requestData
  • M.rotate
  • M.scale
  • M.setColor
  • M.setDecal
  • M.setLayer
  • M.setMetallicIntensity
  • M.setMirrored
  • M.setRotation
  • M.setRoughnessIntensity
  • M.setScale
  • M.setSkew
  • M.skew

See Also

  • Livery Editor – Layers / Cursor - Related reference
  • Livery Editor – Layers / Decal - Related reference
  • Livery Editor – Layers / Fill - Related reference
  • UI System Guide - Guide

Decal Operations

Provides per-layer decal operations - querying actions, adding decals, and reading formatted layer data for the cursor/decal UI.

Fill Layers

Manages fill layers - solid colour backgrounds that serve as the base coat in a livery.

On this page

OverviewExports (M)Data FieldsInternalsStep UnitsgetData FormatNotify PatternHow It WorksExample UsageAdditional ExportsSee Also