API ReferenceGE Extensionsuiappsminimap
Minimap Layers
Z-order layer constants for minimap draw primitives.
Z-order layer constants for minimap draw primitives.
Overview
ui_apps_minimap_layers defines numeric layer constants that control the draw order of minimap elements. Lower values render first (bottom); higher values render on top.
Module path: lua/ge/extensions/ui/apps/minimap/layers.lua
Usage: local layers = require("ui/apps/minimap/layers")
Layer Constants
| Constant | Value | Description |
|---|---|---|
BACKGROUND | 0 | Background fill |
BG_GRID | 10 | Background grid lines |
ROADS_BG | 20 | Road segment outlines (dark stroke) |
ROADS_FG | 30 | Road segment fills (colored) |
ROUTE_BG | 40 | Navigation route outline (white) |
ROUTE_FG | 50 | Navigation route fill (blue) |
GAMEPLAY_MARKERS | 60 | Mission/playmode markers |
VEHICLES_OTHER | 70 | Non-player vehicles |
VEHICLES_POLICE | 80 | Police vehicles |
VEHICLES_USABLE | 90 | Switchable/usable vehicles |
VEHICLE_PLAYER | 100 | Player vehicle (always on top of others) |
ROUND_OR_SQUARE_MASK | 110 | Circle/rect occlusion mask |
COMPASS | 120 | North compass indicator |
ROUTE_POINTER | 130 | Off-screen route direction pointer |
GAMEPLAY_POINTER | 140 | Off-screen gameplay marker pointer |
DEBUG | 150 | Debug overlays (topmost) |
How It Works
All minimap draw calls pass a layer value as the last argument to TextureDrawPrimitive methods (td:circle, td:line, td:triangle, etc.). The engine sorts primitives by layer before rendering.
local layers = require("ui/apps/minimap/layers")
-- Road background drawn at layer 20, foreground at 30
td:lineRoundEnd(x1, y1, x2, y2, w, w, 0, bgColor, bgColor, 0, 0, 0, layers.ROADS_BG)
td:lineRoundEnd(x1, y1, x2, y2, w, w, 0, fgColor, fgColor, 0, 0, 0, layers.ROADS_FG)This ensures consistent visual layering regardless of draw call order in code.
Additional Exports
The following exports are available but not yet documented in detail:
M.BACKGROUNDM.BG_GRIDM.COMPASSM.DEBUGM.GAMEPLAY_MARKERSM.GAMEPLAY_POINTERM.ROADS_BGM.ROADS_FGM.ROUND_OR_SQUARE_MASKM.ROUTE_BGM.ROUTE_FGM.ROUTE_POINTERM.VEHICLES_OTHERM.VEHICLES_POLICEM.VEHICLES_USABLEM.VEHICLE_PLAYER