Difference between revisions of "TGame.OnClockTick"

From Soldat Community Wiki
Jump to: navigation, search
m
m (typo)
Line 7: Line 7:
 
<br>  
 
<br>  
  
==Exmaple==
+
==Example==
 
<syntaxhighlight lang="pascal">
 
<syntaxhighlight lang="pascal">
 
  procedure MyOnClockTickHandler(Ticks: Integer);
 
  procedure MyOnClockTickHandler(Ticks: Integer);

Revision as of 14:34, 24 July 2013

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

Description

Event property called on iddle 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;