| Next revision | Previous revision | ||
|
hpl2:tutorials:script:player_blink [2013/07/08 22:06] amn created |
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> | ||
| + | |||
| + | |||
| + | <code php> | ||
| + | void BlinkTimed( string &in asTimer ) | ||
| + | { | ||
| + | Blink(); | ||
| + | AddTimer ( "", RandFloat(6,10), "BlinkTimed" ); | ||
| + | } | ||
| + | </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.- | ||