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 Cursor

Manages the decal placement cursor - position, scale, skew, rotation, colour, material properties, and mirror settings.

Manages the decal placement cursor - position, scale, skew, rotation, colour, material properties, and mirror settings.


Overview

ui_liveryEditor_layers_cursor controls the "cursor" used to preview and place new decals. It wraps the dynamic decals API cursor/decal properties and notifies the UI of changes. It also provides default values and a reset mechanism.

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


Exports (M)

FunctionSignatureDescription
translate(steps_x, steps_y)Moves cursor position by step increments.
setPosition(posX, posY)Sets cursor position absolutely.
scale(steps_x, steps_y)Adjusts cursor scale by steps.
setScale(scaleX, scaleY)Sets cursor scale absolutely.
skew(steps_x, steps_y)Adjusts cursor skew by steps.
setSkew(skewX, skewY)Sets cursor skew absolutely.
rotate(degrees, counterClockwise)Rotates cursor by degree steps.
setRotation(degrees)Sets cursor rotation absolutely.
setColor(color)Sets RGBA colour array on the cursor.
setMetallicIntensity(value)Sets metallic intensity (0–1).
setRoughnessIntensity(value)Sets roughness intensity (0–1).
setMirrored(mirrored, flipped)Sets mirror and flip flags.
setMirrorOffset(offset)Sets the mirror offset distance.
setUseMousePos(value)Toggles mouse-driven vs cursor-driven placement.
setProjectSurfaceNormal(value)Toggles projecting along the surface normal.
setDecal(texture)Sets the colour texture path. Ensures alpha > 0.
setCursorProperties(params)Bulk-sets cursor properties from a params table.
resetProperties(params)Resets specific or all properties to defaults.
getData() → tableReturns the full cursor state as a UI-friendly table.
requestData()Triggers LiveryEditor_CursorUpdated with current data.
notifyListeners()Alias for requestData - fires LiveryEditor_CursorUpdated.

Exported Constants

ConstantValueDescription
DEFAULT_POSITIONPoint2F(0.5, 0.5)Default cursor position (center).
DEFAULT_SCALEvec3(0.5, 1, 0.5)Default cursor scale.
DEFAULT_SKEWPoint2F(0, 0)Default cursor skew.
DEFAULT_ROTATION0Default rotation in degrees.
DEFAULT_COLORPoint4F(1, 1, 1, 1)Default colour (white, full alpha).
DEFAULT_METALLICINTENSITY0Default metallic intensity.
DEFAULT_ROUGHNESSINTENSITY0Default roughness intensity.
DEFAULT_MIRROREDfalseDefault mirror state.
DEFAULT_FLIP_MIRROREDfalseDefault flip-mirror state.
DEFAULT_MIRROR_OFFSET0Default mirror offset.

Internals

Step Units

TRANSLATE_STEP_UNIT = 0.001
ROTATE_STEP_UNIT    = 0.1
SCALE_STEP_UNIT     = 0.01
SKEW_STEP_UNIT      = 0.01

Default Values

DEFAULT_POSITION           = Point2F(0.5, 0.5)
DEFAULT_SCALE              = vec3(0.5, 1, 0.5)
DEFAULT_SKEW               = Point2F(0, 0)
DEFAULT_ROTATION           = 0
DEFAULT_COLOR              = Point4F(1, 1, 1, 1)
DEFAULT_METALLICINTENSITY  = 0
DEFAULT_ROUGHNESSINTENSITY = 0
DEFAULT_MIRRORED           = false
DEFAULT_FLIP_MIRRORED      = false
DEFAULT_MIRROR_OFFSET      = 0

Reset Params

resetProperties accepts an optional array of property names: "position", "scale", "skew", "rotation", "color", "metallicIntensity", "roughnessIntensity", "material" (resets color + metallic + roughness), "mirror", "transform" (alias for position).


How It Works

  1. Every setter wraps the corresponding api.set* call
  2. After each change, notifyListeners() triggers LiveryEditor_CursorUpdated with the full cursor data
  3. The UI reads position, scale, rotation, colour, etc. from the triggered data
  4. resetProperties() restores defaults selectively or globally

Example Usage

local cursor = extensions.ui_liveryEditor_layers_cursor

-- Set a decal texture and position
cursor.setDecal("/art/decals/logo.png")
cursor.setPosition(0.5, 0.5)
cursor.setScale(0.3, 0.3)
cursor.setColor({1, 0, 0, 1})  -- red

-- Reset everything
cursor.resetProperties()

Additional Exports

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

  • M.DEFAULT_COLOR
  • M.DEFAULT_FLIP_MIRRORED
  • M.DEFAULT_METALLICINTENSITY
  • M.DEFAULT_MIRRORED
  • M.DEFAULT_MIRROR_OFFSET
  • M.DEFAULT_POSITION
  • M.DEFAULT_ROTATION
  • M.DEFAULT_ROUGHNESSINTENSITY
  • M.DEFAULT_SCALE
  • M.DEFAULT_SKEW
  • M.getData
  • M.notifyListeners
  • M.requestData
  • M.resetProperties
  • M.rotate
  • M.scale
  • M.setColor
  • M.setCursorProperties
  • M.setDecal
  • M.setMetallicIntensity
  • M.setMirrorOffset
  • M.setMirrored
  • M.setPosition
  • M.setProjectSurfaceNormal
  • M.setRotation
  • M.setRoughnessIntensity
  • M.setScale
  • M.setSkew
  • M.setUseMousePos
  • M.skew
  • M.translate

See Also

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

Math Utilities

Math and conversion utilities shared across the livery editor modules.

Decal Operations

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

On this page

OverviewExports (M)Exported ConstantsInternalsStep UnitsDefault ValuesReset ParamsHow It WorksExample UsageAdditional ExportsSee Also