OnClientPreRender: Difference between revisions
Jump to navigation
Jump to search
(Added a link to the game processing order page.) |
mNo edit summary |
||
Line 7: | Line 7: | ||
float timeSlice | float timeSlice | ||
</syntaxhighlight> | </syntaxhighlight> | ||
*'''timeSlice:''' The interval between this frame and the previous one in milliseconds. | *'''timeSlice:''' The interval between this frame and the previous one in milliseconds (delta time). | ||
==Source== | ==Source== |
Revision as of 05:53, 7 September 2013
This event is triggered every time before GTA renders a new frame.
Parameters
float timeSlice
- timeSlice: The interval between this frame and the previous one in milliseconds (delta time).
Source
The source of this event is the client's root element.
Example
This example makes the camera follow the player in a GTA2-like way.
root = getRootElement () function updateCamera () local x, y, z = getElementPosition ( getLocalPlayer () ) setCameraMatrix ( x, y, z + 50, x, y, z ) end addEventHandler ( "onClientPreRender", root, updateCamera )
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