a simple rectangle class. It has four slots x, y, width and height and
can be created from or converted to other formats very easily.
-
copy()
- return a new Rect instance having the same values
as self.
-
classmethod from_dict(dic)
- Create a new Rect instance from the dictionary dic that
has four keys: ‘x’ ‘y’, ‘width’ and ‘height’.
-
classmethod from_object(struct)
- Create a new Rect instance from the object struct that
has four slots: x, y, width and height.
-
to_dict()
- return a dictionary having the keys ‘x’, ‘y’, ‘width’ and ‘height’,
containing self’s values.