OnClientPreRender: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Added a link to the game processing order page.)
Line 24: Line 24:


==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}}

Revision as of 02:40, 20 April 2012

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.

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


Client event functions