OnClientHUDRender: Difference between revisions
Jump to navigation
Jump to search
(Created page with "__NOTOC__ {{Client event}} This event is triggered before GTA renders the HUD. This is particularly useful if you want to use dxUpdateScreenSource to capture the screen onto...") |
m (Incorrectly categorized as 'Needs Example'.) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 11: | Line 11: | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
- | 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) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
===[[Game_Processing_Order|Game Processing Order]]=== | |||
===Other client events=== | ===Other client events=== | ||
{{Client_other_events}} | {{Client_other_events}} | ||
===Client event functions=== | ===Client event functions=== | ||
{{Client_event_functions}} | {{Client_event_functions}} | ||
Latest revision as of 11:10, 25 June 2012
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
None
Source
The source of this event is the client's root element.
Example
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)
See Also
Game Processing Order
Other client events
- onClientChatMessage
- onClientConsole
- onClientDebugMessage
- onClientExplosion
- onClientFileDownloadComplete
- onClientHUDRender
- onClientMinimize
- onClientMTAFocusChange
- onClientPedsProcessed
- onClientPlayerNetworkStatus
- onClientPreRender
- onClientRender
- onClientRestore
- onClientTransferBoxProgressChange
- onClientTransferBoxVisibilityChange
- onClientWorldSound
Client event functions
- triggerLatentServerEvent
- triggerServerEvent
- Shared
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled