Difference between revisions of "TGame.OnClockTick"

From Soldat Community Wiki
Jump to: navigation, search
(Created page with " '''''property OnClockTick''''' Access mode: RW ==Description== Event property called on iddle in frequency described by TickThreshold <br> ==Exma...")
 
m (Description: `iddle` typo changed to `idle`)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
  '''''property OnClockTick'''''
 
  '''''property OnClockTick'''''
 
   Access mode: RW
 
   Access mode: RW
 +
  Event handler type: [[TOnClockTickEvent]]
 +
  Event handler declaration: procedure (Ticks: Integer);
  
 
==Description==
 
==Description==
Event property called on iddle in frequency described by [[TGame.TickThreshold|TickThreshold]]
+
Event property called on idle in frequency described by [[TGame.TickThreshold|TickThreshold]]
<br>  
+
<br>
  
==Exmaple==
+
==Example==
 
<syntaxhighlight lang="pascal">
 
<syntaxhighlight lang="pascal">
 
  procedure MyOnClockTickHandler(Ticks: Integer);
 
  procedure MyOnClockTickHandler(Ticks: Integer);
Line 16: Line 18:
  
 
  begin
 
  begin
   // assign OnClockTickHandler
+
   // assign OnClockTick handler
 
   Game.OnClockTick := @MyOnClockTickHandler;
 
   Game.OnClockTick := @MyOnClockTickHandler;
  
Line 26: Line 28:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
[[Category:TGame]]
+
[[Category:TGame]][[Category:Events]]

Latest revision as of 13:55, 29 July 2013

property OnClockTick
 Access mode: RW
 Event handler type: TOnClockTickEvent
 Event handler declaration: procedure (Ticks: Integer);

Description

Event property called on idle in frequency described by TickThreshold

Example

 procedure MyOnClockTickHandler(Ticks: Integer);
 begin
   WriteLn('OnClockTick event called: ' + IntToStr(Ticks));
 end;

 // ...

 begin
   // assign OnClockTick handler
   Game.OnClockTick := @MyOnClockTickHandler;

   // ...

   // unassign
   Game.OnClockTick := nil;
 end;