| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <html>
- <head>
- <title>Blitz3D Docs</title>
- <link rel=stylesheet href=../css/commands.css type=text/css>
- </head>
- <body>
- <h1>CreateTimer (frequency)</h1>
- <h1>Parameters</h1>
- <table>
- <tr>
- <td>
- frequency = usually a framerate like 50 or 60
- </td>
- </tr>
- </table>
- <h1>Description</h1>
- <table>
- <tr>
- <td>
- Use this command in conjunction with the WaitTimer command to control the speed of program execution (fps). You will use this in your main screen redraw loop to control the playback speed to match the proper speed. This will prevent your games from playing back too fast on computers faster than yours. Use of this system is VERY GOOD practice, as your game will be played on a variety of computers.
- </td>
- </tr>
- </table>
- <h1><a href=../2d_examples/CreateTimer.bb>Example</a></h1>
- <table>
- <tr>
- <td>
- ; Create the timer to track speed
<br />
- frameTimer=CreateTimer(60)
<br />
-
<br />
- ; Your main screen draw loop
<br />
- While Not KeyHit(1)
<br />
- WaitTimer(frameTimer) ; Pause until the timer reaches 60
<br />
- Cls
<br />
- ; Draw your screen stuff
<br />
- Flip
<br />
- Wend
<br />
- </td>
- </tr>
- </table>
- <br>
- <a target=_top href=../index.htm>Index</a><br>
- <br>
- Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=CreateTimer&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
- </html>
|