Dynamic Decals - Helper
Shared utility functions for the dynamic decals tool. Provides centered text rendering, image widgets with tooltips, icon tooltips, and string formatting helpers used across all dynamic decal modules.
Shared utility functions for the dynamic decals tool. Provides centered text rendering, image widgets with tooltips, icon tooltips, and string formatting helpers used across all dynamic decal modules.
Public API
| Function | Signature | Description |
|---|---|---|
M.textUnformattedCentered | (label) | Draws text centered horizontally in available region |
M.textColoredCentered | (color, label) | Draws colored text centered horizontally |
M.imageWidget | (path, overrideWidth) | Renders image at full/custom width with dimensions text below |
M.imageTooltip | (path, overrideTooltipWidth) | Shows image in hover tooltip (default size from preferences) |
M.iconTooltip | (msg, inline) | Renders info icon with tooltip message; inline adds SameLine |
M.splitAndCapitalizeCamelCase | (str) → string | Splits camelCase and capitalizes: "myVar" → "My Var" |
M.capitalizeWords | (str) → string | Capitalizes first letter of each word |
M.registerEditorPreferences | (prefsRegistry) | Registers imageTooltip.texturePreviewSize (default 128, range 32–512) |
M.editorPreferenceValueChanged | (path, value) | Preference change callback (stub) |
M.setup | (tool_in) | Stores tool reference |
Usage Examples
local helper = extensions.editor_dynamicDecals_helper
-- Centered title
helper.textUnformattedCentered("My Section Title")
-- Colored centered text
helper.textColoredCentered(editor.color.beamng.Value, "Important!")
-- Image with border
helper.imageWidget("/art/textures/my_texture.png") -- full width
helper.imageWidget("/art/textures/my_texture.png", 256) -- 256px wide
-- Tooltip on hover over previous widget
helper.imageTooltip("/art/textures/my_texture.png", 512)
-- Info icon with tooltip (inline after previous widget)
helper.iconTooltip("This setting controls X", true)
-- String formatting
helper.capitalizeWords("hello world") -- "Hello World"
helper.splitAndCapitalizeCamelCase("camelCaseString") -- "Camel Case String"Preferences
| Key | Type | Default | Range | Description |
|---|---|---|---|---|
imageTooltip.texturePreviewSize | float | 128 | 32–512 | Default tooltip image width |
Dependencies
| Module | Purpose |
|---|---|
editor | getTempTextureObj(), uiIconImage(), icon assets |
See Also
- Dynamic Decals - Browser - Related reference
- Dynamic Decals - Brushes - Related reference
- Dynamic Decals - Camera - Related reference
- World Editor Guide - Guide
Dynamic Decals - Gizmo
3D transform gizmo controller for the dynamic decals tool. Manages translate/rotate/scale modes, axis gizmo lifecycle (begin/drag/end), bounding box visualization, and per-mode callback dispatch. The
Dynamic Decals History
Editor module providing undo/redo history GUI for the Dynamic Decals tool. Displays undo and redo stacks with selectable entries and bulk undo/redo support.