QBCore Frameworkqbcore.netCommunity docs
On this page

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

Found an issue in this guide?

Send the page URL, the affected example, and a source or reproduction to the site maintainer. For a server or resource problem, use the support guide.

On this page

Leonida RP server website built with RPWebsite
RPWebsite

Advertisement · RPWebsite

Want a website for your server?

Launch a site with live player status, rules, and a join button in minutes.

Build your website