Squirrel/Client/Events/Misc/onClientRender

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with '{{Squirrel/Title|onClientRender}} {{Warning|This event is called every frame. It is not recommended to run any heavy code under this.}} This event is called every frame. == Syn…')
 
(Added example)
 
Line 14: Line 14:
 
== Example ==
 
== Example ==
  
Some explanation here
+
This code will tell the player how many frames have been rendered since the scripts were loaded. It will also increase a counter that counts the number of frames.
{{Squirrel/NeedsExample}}
+
  
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
local frames = 0;
 +
function onClientRender()
 +
{
 +
    Message("Rendered " + ++frames + " frames so far.");
 +
}
 
</code>
 
</code>
  
 
=== Notes ===
 
=== Notes ===
  
-- List of used functions and other notes here.
+
The function [[Squirrel/Client/Functions/Messages/Message|Message]] was used in this example. More information can be found in its corresponding page.
  
 
== Related Events ==
 
== Related Events ==
  
 
{{Squirrel/Client/Events/Misc}}
 
{{Squirrel/Client/Events/Misc}}

Latest revision as of 02:59, 2 August 2011

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events
LU Warning: This event is called every frame. It is not recommended to run any heavy code under this.


This event is called every frame.

[edit] Syntax

  1. function onClientRender()

[edit] Arguments

  • none

[edit] Example

This code will tell the player how many frames have been rendered since the scripts were loaded. It will also increase a counter that counts the number of frames.

  1.  
  2. local frames = 0;
  3. function onClientRender()
  4. {
  5. Message("Rendered " + ++frames + " frames so far.");
  6. }
  7.  

[edit] Notes

The function Message was used in this example. More information can be found in its corresponding page.

[edit] Related Events

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox