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
Layer GroupingMaterial ToolLayer UtilitiesLayer ManagementTransform Tool

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 ExtensionsuiliveryEditortools

Transform Tool

Transform tool - translate, rotate, scale, skew, and stamp operations for cursor and decal layers.

Transform tool - translate, rotate, scale, skew, and stamp operations for cursor and decal layers.


Overview

ui_liveryEditor_tools_transform is the primary spatial editing tool. It provides translate, rotate, scale, skew, and stamp operations, dispatching to the appropriate handler (cursor, decal, or group) via doOperation.

Extension path: lua/ge/extensions/ui/liveryEditor/tools/transform.lua


Exports (M)

FunctionSignatureDescription
useStamp()Enters stamp mode - matches cursor to selected layer, hides layer, enables mouse projection.
cancelStamp()Cancels stamp mode - restores layer visibility, returns to cursor projection.
translate(steps_x, steps_y)Translates cursor by step increments.
setPosition(posX, posY)Sets cursor position absolutely.
rotate(degrees, counterClockwise)Rotates cursor or decal layer by degrees.
setRotation(degrees)Sets absolute rotation on cursor or decal layer.
scale(steps_x, steps_y)Scales cursor or decal layer by steps.
setScale(scaleX, scaleY)Sets absolute scale on cursor or decal layer.
skew(steps_x, steps_y)Skews cursor or decal layer by steps.
setSkew(skewX, skewY)Sets absolute skew on cursor or decal layer.

Internals

Stamp Mode

Stamp mode lets the user reposition a placed decal by projecting it through the cursor:

M.useStamp = function()
  local layer = api.getLayerByUid(layerUid)
  -- Copy layer properties to cursor
  api.setDecalRotation(layer.decalRotation)
  api.setDecalScale(layer.decalScale)
  api.setDecalSkew(layer.decalSkew)
  api.setDecalColor(layer.color)
  -- Hide layer (alpha=0), show cursor, enable mouse
  layer.color = Point4F(layer.color.x, layer.color.y, layer.color.z, 0)
  api.setLayer(layer, true)
end

Type-Based Dispatch

Each transform function routes by layer type:

LayerHandler
nil (cursor)ui_liveryEditor_layers_cursor
decalui_liveryEditor_layers_decals
groupLogged as "not implemented yet"

Step Units (internal reference)

TRANSLATE_STEP_UNIT = 0.1
ROTATE_STEP_UNIT    = 1
SCALE_STEP_UNIT     = 0.1
SKEW_STEP_UNIT      = 0.1

Note: These are larger than the cursor/layerEdit step units (designed for the tool slider UI).


How It Works

  1. The transform tool is activated via ui_liveryEditor_tools.useTool("transform")
  2. Operations dispatch through doOperation to cursor or layer handlers
  3. Stamp mode copies layer properties to the cursor for visual repositioning
  4. cancelStamp restores the original layer; confirming stamps via editor module
  5. Group transforms are stubbed but not yet implemented

Example Usage

local transform = extensions.ui_liveryEditor_tools_transform

-- Enter stamp mode for the selected layer
transform.useStamp()

-- Rotate the active target by 15 degrees clockwise
transform.rotate(15, false)

-- Set absolute scale
transform.setScale(0.5, 0.5)

-- Cancel stamp
transform.cancelStamp()

Additional Exports

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

  • M.cancelStamp
  • M.rotate
  • M.scale
  • M.setPosition
  • M.setRotation
  • M.setScale
  • M.setSkew
  • M.skew
  • M.translate

See Also

  • Livery Editor – Tools / Group - Related reference
  • Livery Editor – Tools / Material - Related reference
  • Livery Editor – Tools / Misc - Related reference
  • UI System Guide - Guide

Layer Management

Provides layer management tool operations for the livery editor.

Top Bar Config

Static configuration of top bar navigation entries and their flags.

On this page

OverviewExports (M)InternalsStamp ModeType-Based DispatchStep Units (internal reference)How It WorksExample UsageAdditional ExportsSee Also