OnClientPreRender: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
m (→Example: does't work with getLocalPlayer() as second argument in addEventHandler) |
||
Line 19: | Line 19: | ||
setCameraMatrix ( x, y, z + 50, x, y, z ) | setCameraMatrix ( x, y, z + 50, x, y, z ) | ||
end | end | ||
addEventHandler ( "onClientPreRender", | addEventHandler ( "onClientPreRender", root, updateCamera ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 13:13, 7 August 2009
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.
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.
function updateCamera () local x, y, z = getElementPosition ( getLocalPlayer () ) setCameraMatrix ( x, y, z + 50, x, y, z ) end addEventHandler ( "onClientPreRender", root, updateCamera )
See Also
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