| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <html>
- <head>
- <title>Blitz3D Docs</title>
- <link rel=stylesheet href=../css/commands.css type=text/css>
- </head>
- <body>
- <h1>Rect x, y, width, height, solid</h1>
- <h1>Parameters</h1>
- <table>
- <tr>
- <td>
- x = x coordinate to begin drawing the rectangle
<br />
- y = y coordinate to begin drawing the rectangle
<br />
- width = how wide to make the rectangle in pixels
<br />
- height = how tall to make the rectangle in pixels
<br />
- solid = 0 or False for unfilled and 1 or True for filled
- </td>
- </tr>
- </table>
- <h1>Description</h1>
- <table>
- <tr>
- <td>
- 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'.
- </td>
- </tr>
- </table>
- <h1><a href=../2d_examples/Rect.bb>Example</a></h1>
- <table>
- <tr>
- <td>
- ; Flip/Backbuffer()/Rect Example
<br />
-
<br />
- ; Set Graphics Mode
<br />
- Graphics 640,480
<br />
-
<br />
- ; Go double buffering
<br />
- SetBuffer BackBuffer()
<br />
-
<br />
- ; Setup initial locations for the box
<br />
- box_x = -20 ; negative so it will start OFF screen
<br />
- box_y = 100
<br />
-
<br />
- While Not KeyHit(1)
<br />
- Cls ; Always clear screen first
<br />
- Rect box_x,box_y,20,20,1 ; Draw the box in the current x,y location
<br />
- Flip ; Flip it into view
<br />
- box_x = box_x + 1 ; Move the box over one pixel
<br />
- If box_x = 640 Then box_x=-20 ; If it leaves the Right edge, reset its x location
<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=Rect&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
- </html>
|