DrawText helpers
qb-core/client/drawtext.lua exposes four client-side helpers backed by the core NUI:
DrawText, ChangeText, HideText, and KeyPressed.
exports['qb-core']:DrawText('[E] Open garage', 'left')
exports['qb-core']:ChangeText('[E] Close garage', 'left')
exports['qb-core']:KeyPressed()
exports['qb-core']:HideText()DrawText and ChangeText default the position to left when the second argument is not a
string. KeyPressed sends its NUI action, waits 500 milliseconds, and then hides the text.
Equivalent client events are registered as qb-core:client:DrawText,
qb-core:client:ChangeText, qb-core:client:HideText, and qb-core:client:KeyPressed.
Prefer direct exports for calls inside your own client resource. Show text when interaction state begins, update only when its label changes, and hide it when that state ends.
Source: client/drawtext.luaΒ
Last updated on