Rect.htm 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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>Rect x, y, width, height, solid</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. x = x coordinate to begin drawing the rectangle <br />
  13. y = y coordinate to begin drawing the rectangle <br />
  14. width = how wide to make the rectangle in pixels <br />
  15. height = how tall to make the rectangle in pixels <br />
  16. solid = 0 or False for unfilled and 1 or True for filled
  17. </td>
  18. </tr>
  19. </table>
  20. <h1>Description</h1>
  21. <table>
  22. <tr>
  23. <td>
  24. This command will draw a rectangle in the current drawing Color starting at the location specified. The last parameter determines if the rectangle is filled or just a 'box'.
  25. </td>
  26. </tr>
  27. </table>
  28. <h1><a href=../2d_examples/Rect.bb>Example</a></h1>
  29. <table>
  30. <tr>
  31. <td>
  32. ; Flip/Backbuffer()/Rect Example <br />
  33. <br />
  34. ; Set Graphics Mode <br />
  35. Graphics 640,480 <br />
  36. <br />
  37. ; Go double buffering <br />
  38. SetBuffer BackBuffer() <br />
  39. <br />
  40. ; Setup initial locations for the box <br />
  41. box_x = -20 ; negative so it will start OFF screen <br />
  42. box_y = 100 <br />
  43. <br />
  44. While Not KeyHit(1) <br />
  45. Cls ; Always clear screen first <br />
  46. Rect box_x,box_y,20,20,1 ; Draw the box in the current x,y location <br />
  47. Flip ; Flip it into view <br />
  48. box_x = box_x + 1 ; Move the box over one pixel <br />
  49. If box_x = 640 Then box_x=-20 ; If it leaves the Right edge, reset its x location <br />
  50. Wend <br />
  51. </td>
  52. </tr>
  53. </table>
  54. <br>
  55. <a target=_top href=../index.htm>Index</a><br>
  56. <br>
  57. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=Rect&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  58. </html>