Rect Class Reference

Width and height of an array. More...

Functions

def width (self)
 Array width in pixels.
 
def height (self)
 Array height in pixels.
 
def x (self)
 x coordinate of top-left corner
 
def y (self)
 y coordinate of top-left corner
 
def area (self)
 Returns the area of the image. More...
 
def is_empty (self)
 Tests if the given Rect is empty (width or/and height is null) More...
 
def contains (self, Rect target, proper=False)
 Tests if this Rect contains the <target> Rect. More...
 
def is_contained (self, Rect target, proper=False)
 Tests if this Rect is contained inside the given <target> Rect. More...
 

Detailed Description

Width and height of an array.

Functions

◆ area()

def area (   self)

Returns the area of the image.

Returns
The number of pixels of the array.

◆ is_empty()

def is_empty (   self)

Tests if the given Rect is empty (width or/and height is null)

Returns
Returns True if rectangle is empty

◆ contains()

def contains (   self,
Rect  target,
  proper = False 
)

Tests if this Rect contains the <target> Rect.

Returns
Returns true if this rectangle contains the <target> rectangle. Otherwise returns false. If proper is true, this function only returns true if the target rectangle is entirely inside this rectangle (not on the edge).

◆ is_contained()

def is_contained (   self,
Rect  target,
  proper = False 
)

Tests if this Rect is contained inside the given <target> Rect.

Returns
Returns true if this rectangle is inside the current target Rect. Otherwise returns false. If proper is true, this function only returns true if this rectangle is entirely inside the <target> rectangle (not on the edge).