FreeTimer.htm 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <html>
  2. <head>
  3. <title>Blitz3D Docs</title>
  4. <link rel=stylesheet href=../css/commands.css type=text/css>
  5. </head>
  6. <body>
  7. <h1>FreeTimer (timer_variable)</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. timer = any valid timer variable created with the CreateTimer command.
  13. </td>
  14. </tr>
  15. </table>
  16. <h1>Description</h1>
  17. <table>
  18. <tr>
  19. <td>
  20. This command will destroy a timer variable created with the with the CreateTimer command and free the memory it was using. It is a good practice to destroy elements in your game you are no longer using.
  21. </td>
  22. </tr>
  23. </table>
  24. <h1><a href=../2d_examples/FreeTimer.bb>Example</a></h1>
  25. <table>
  26. <tr>
  27. <td>
  28. ; Create the timer to track speed <br />
  29. frameTimer=CreateTimer(60) <br />
  30. <br />
  31. ; Your main screen draw loop <br />
  32. While Not KeyHit(1) <br />
  33. WaitTimer(frameTimer) ; Pause until the timer reaches 60 <br />
  34. Cls <br />
  35. ; Draw your screen stuff <br />
  36. Flip <br />
  37. Wend <br />
  38. <br />
  39. ; Kill the timer <br />
  40. FreeTimer(frameTimer) <br />
  41. </td>
  42. </tr>
  43. </table>
  44. <br>
  45. <a target=_top href=../index.htm>Index</a><br>
  46. <br>
  47. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=FreeTimer&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  48. </html>