dxRect(x%,y%,width%,height%,solid%)

Parameters

x = x coordinate to begin drawing the rectangle
y = y coordinate to begin drawing the rectangle
width = how wide to make the rectangle in pixels
height = how tall to make the rectangle in pixels
solid = 0 or False for unfilled and 1 or True for filled

Description

This command will draw a rectangle in the current drawing dxColor starting at the location specified. The last parameter determines if the rectangle is filled or just a 'box'.

Example

; dxFlip/dxBackBuffer()/dxRect Example

; Set Graphics Mode
Graphics 640,480

; Go double buffering
dxSetBuffer dxBackBuffer()

; Setup initial locations for the box
box_x = -20 ; negative so it will start OFF screen
box_y = 100

While Not dxKeyHit(1)
dxCls ; Always clear screen first
dxRect box_x,box_y,20,20,1 ; Draw the box in the current x,y location
dxFlip ; dxFlip it into view
box_x = box_x + 1 ; Move the box over one pixel
If box_x = 640 Then box_x=-20 ; If it leaves the Right edge, reset its x location
Wend

Index