User Tools

Site Tools


hpl2:tutorials:script:player_blink

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
hpl2:tutorials:script:player_blink [2013/07/08 22:08]
amn
hpl2:tutorials:script:player_blink [2013/12/19 20:01] (current)
amn
Line 1: Line 1:
 +====== Player Blink ======
 +
 +
 This simulates an eye blink every 6~10 seconds. This simulates an eye blink every 6~10 seconds.
  
  
 \\  \\ 
-Create the following functions in your script file+Create the following functions in your script file:
  
  
Line 10: Line 13:
 { {
           FadeOut(0);           FadeOut(0);
-          ​FadeOut(0.1);+          ​FadeIn(0.1);
 } }
 </​code>​ </​code>​
Line 16: Line 19:
  
 <code php> <code php>
-void BlinkTimed()+void BlinkTimed( ​string &in asTimer ​)
 { {
-               Blink(); +          ​Blink(); 
-               ​AddTimer ( "",​ RandFloat(6,​10),​ "​BlinkTimed"​ );+          AddTimer ( "",​ RandFloat(6,​10),​ "​BlinkTimed"​ );
 } }
 </​code>​ </​code>​
 +
 +
 +Then, add this line to your OnStart()
 +
 +
 +<code php>
 +           ​AddTimer ( "",​ RandFloat(6,​10),​ "​BlinkTimed"​ );
 +</​code>​
 +
 +
 +With this code, the screen will simulate a blink every 6~10 seconds.
 +
 +
 +Amn.-
  
hpl2/tutorials/script/player_blink.1373321329.txt.gz · Last modified: 2013/07/08 22:08 by amn