Road Architect - Decals
Manages road surface decals (lane markings, arrows, patches) for the Road Architect. Creates, positions, and manages DecalRoad and MeshRoad Torque objects along lane edges and surfaces.
Manages road surface decals (lane markings, arrows, patches) for the Road Architect. Creates, positions, and manages DecalRoad and MeshRoad Torque objects along lane edges and surfaces.
Public Functions
| Function | Signature | Description |
|---|---|---|
M.createDecal | (...) | Creates a road surface decal |
M.tryRemove | (...) | Attempts to remove a decal |
M.removeTemplates | (...) | Removes decal templates |
M.tryRemoveAll | (...) | Attempts to remove all decals |
Example: Road Decal Management
local decals = require('editor/tech/roadArchitect/decals')
-- Create decals for a road after geometry is computed
decals.createDecals(road)
-- When road geometry changes, mark dirty then update
decals.setDecalsDirty(road)
decals.tryUpdateDecals(road)
-- Remove decals when deleting a road
decals.removeDecals(road)
-- Remove all decals from all roads (e.g., on level unload)
decals.removeAllDecals(roads)
-- Available material presets for lane markings
local mats = decals.getDecalMaterials()
-- Includes: solid_white, dashed_white, solid_yellow, dashed_yellow, etc.
-- Decal types placed per-lane:
-- Edge lines - along lane outer boundaries
-- Center lines - between opposing traffic lanes
-- Lane arrows - directional indicators at intersections
-- Surface patches - textured overlays on road surfaceNotes
- Decals are Torque DecalRoad objects positioned along render data polylines
- Materials reference pre-existing texture assets in the game
- Decal placement follows the road's render data lateral offsets
Functions
tryRemove(name)
Handles try remove.
name(string)
removeTemplates()
Removes templates.
tryRemoveAll()
Handles try remove all.
Returns: self
Functions
tryRemove(name)
Handles try remove.
name(string)
removeTemplates()
Removes templates.
tryRemoveAll()
Handles try remove all.
Returns: self
See Also
- Road Architect - Clothoid - Related reference
- Road Architect - Export - Related reference
- Road Architect - Geometry - Related reference
- World Editor Guide - Guide
Road Architect - Clothoid
Provides clothoid (Euler spiral) fitting for road nodes. Computes smooth curvature-continuous transitions between road segments using Fresnel integrals, with support for arc length parameterization an
Road Architect - Export
Handles serialization and export of Road Architect road data to JSON files. Converts road structures (nodes, profiles, layers, groups, junctions, overlays) into a portable format.