
cr-3dnui
Interactive 3D DUI/NUI panels for FiveM — real web apps on in-game surfaces
This is a API designed for developers to render menus / games / nuis / duis …on any surface within fivem and have them interactable.
Features
- Live DUI rendering (
CreateDui) usingnui://...- World-space quad rendering (position + normal)
- Camera raycast → UV mapping (0…1)
- Two interaction styles:
- Message-based input (simple menus)
- Native mouse injection (hover/drag behavior)
- Example includes:
- Brush + eraser drawing (drag)
- Text placement (onscreen keyboard commit)
- DUI-safe custom font dropdown
Usage (high level)
- Create a panel with a
nui://resource/html/page.htmlURL- Draw it on a world quad
- Raycast to the panel, convert hit point → UV
- Forward input to the DUI page
- Use
RegisterNUICallbackfor actions back into Lua
Notes / limitations
- DUI is not fullscreen NUI; some browser UI features behave differently.
- Native
<select>dropdowns often don’t work in DUI. Use a custom dropdown.
Demos (Whiteboard/Snake/Car)
This repo includes
cr-3dnui_whiteboarddemocr-3dnui_snakedemoandcr-3dnui_cardemoas optional example resources.Start after the library:
(one or the other)
ensure cr-3dnui
# Choose ONE demo at a time:
ensure cr-3dnui_whiteboarddemo
# OR
ensure cr-3dnui_snakedemo
#OR
ensure cr-3dnui_cardemo
Demo Controls… ( whiteboard / snake )
- Use F7 to enter placement mode.
- Press E to place.
- Press G to interact with board
Demo Controls… ( cardemo )
- Use
/nuiroofto create panel roof while seating a vehicle.- Use
/nuioffto remove panel.- Use F6 to enter/leave interaction with panel via KEY2DUI input
Demo Controls… ( DEBUG TOOL cardemo )
- Use
/nuiroofto create panel roof while seating a vehicle.- Use
/nuioffto remove panel.- Use
/nuidashto place prop and interactive panel on dash- Use
/nuidashpropto bind the panel to prop (this is REQUIRED to be used BEFORE/dashprint)- Use
/dashtuneallows scrollwheel to modifty X/Y/Z/ROT when enabled (for small adjustments holdCTRL…for big adjustments holdSHIFT)- Use
/dashaxis <x|y|z|rx|ry|rz>change axis- Use
/dashprintoutputs your offsets/normals/XYZ/ROT in F8 Console
The demos are meant to be a reference implementation showing how to:
- create a world-space DUI panel
- raycast it for UV coords
- forward mouse / keyboard input into the web UI
- call back into Lua from the page
- attach to entity
| Code is accessible | Yes |
| Subscription-based | No |
| Lines (approximately) | ~638 |
| Requirements | none |
| Support | Yes (via cfx thread replies) |




