draw_rectangle

Draws a rectangle.

Syntax:

draw_rectangle(x1, y1, x2, y2, outline);


Argument Description
x1 The x coordinate of the top left corner of the rectangle.
y1 The y coordinate of the top left corner of the rectangle.
x2 The x coordinate of the bottom right corner of the rectangle.
y2 The y coordinate of the bottom right corner of the rectangle.
outline Whether the rectangle is drawn filled (false) or as a one pixel wide outline (true).


Returns: N/A


Description

With this function you can draw either an outline of a rectangle or a filled rectangle where the (x1,y1) position is the top left corner and the (x2,y2) position is the bottom right corner.


Example:

draw_set_colour(c_yellow);
draw_rectangle(100, 100, 300, 200, true);

This will draw a rectangle outline, with its top left corner at (100,100) and its bottom right corner at (300,200).


Back: Drawing Basic Forms
Next: draw_rectangle_colour
© Copyright YoYo Games Ltd. 2018 All Rights Reserved