Rectangle constructor

init(self, x=0, y=0, width=0, height=0)

Creates a rectangle with the specified location and size. Float values are truncated to integers.

def __init__(self, x=0, y=0, width=0, height=0):
    ...
ParameterTypeDescription
xintThe x-coordinate of the upper-left corner of the rectangle.
yintThe y-coordinate of the upper-left corner of the rectangle.
widthintThe width of the rectangle.
heightintThe height of the rectangle.

Exceptions

ExceptionDescription
TypeErrorA component is not a number.

See Also