onClientHUDRender | Multi Theft Auto: Wiki Skip to content

onClientHUDRender

Client-side
Server-side
Shared

This event is triggered before GTA renders the HUD. This is particularly useful if you want to use dxUpdateScreenSource to capture the screen onto a texture without capturing the HUD, or to alter HUD textures using shaders before they are drawn onto the screen.

Parameters

This event does not pass any parameters to the handler function.

Source

element: The source of this event is the client's root element.

Code Examples

client
local render_count = 0
addEventHandler("onClientHUDRender", root, function()
render_count = render_count + 1
end)
addEventHandler("onClientRender", root, function()
render_count = render_count - 1
end)
addCommandHandler("getLossFrames", function()
outputChatBox("Loss: "..render_count)
outputDebugString("Loss: "..render_count, 3, 255, 0, 0)
end)