In FiveM, you can also render NUI to a runtime texture, which is called DUI for ‘direct NUI’. The following natives help with this:
The native documentation contains information for each of these, but here are some creative use cases for this:
- Rendering in 2D space using DRAW_SPRITE
- Rendering to a game render target object using similar natives.
- Rendering arbitrarily in world space using a specialized Scaleform, like in this forum topic.
This can be used to make cinema screens, asynchronous in-game hint overlays, etc. fairly trivially.