pygame :: Rect :: Class Rect
[hide private]
[frames] | no frames]

Class Rect

source code

object --+
         |
        Rect

pygame.Rect(left, top, width, height): return Rect pygame.Rect((left, top), (width, height)): return Rect pygame.Rect(object): return Rect pygame object for storing rectangular coordinates

Instance Methods [hide private]
 
__coerce__(x, y)
coerce(x, y)
source code
 
__copy__(...) source code
 
__delitem__(x, y)
del x[y]
source code
 
__delslice__(x, i, j)
del x[i:j]
source code
 
__eq__(x, y)
x==y
source code
 
__ge__(x, y)
x>=y
source code
 
__getitem__(x, y)
x[y]
source code
 
__getslice__(x, i, j)
x[i:j]
source code
 
__gt__(x, y)
x>y
source code
 
__init__(...)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__le__(x, y)
x<=y
source code
 
__len__(x)
len(x)
source code
 
__lt__(x, y)
x<y
source code
 
__ne__(x, y)
x!=y
source code
a new object with type S, a subtype of T
__new__(T, S, ...) source code
 
__nonzero__(x)
x != 0
source code
 
__reduce__(...)
helper for pickle
source code
 
__repr__(x)
repr(x)
source code
 
__setitem__(x, i, y)
x[i]=y
source code
 
__setslice__(x, i, j, y)
x[i:j]=y
source code
 
__str__(x)
str(x)
source code
 
clamp(...)
Rect.clamp(Rect): return Rect moves the rectangle inside another
source code
 
clamp_ip(...)
Rect.clamp_ip(Rect): return None moves the rectangle inside another, in place
source code
 
clip(...)
Rect.clip(Rect): return Rect crops a rectangle inside another
source code
 
collidedict(...)
Rect.collidedict(dict): return (key, value) test if one rectangle in a dictionary intersects
source code
 
collidedictall(...)
Rect.collidedictall(dict): return [(key, value), ...] test if all rectangles in a dictionary intersect
source code
 
collidelist(...)
Rect.collidelist(list): return index test if one rectangle in a list intersects
source code
 
collidelistall(...)
Rect.collidelistall(list): return indices test if all rectangles in a list intersect
source code
 
collidepoint(...)
Rect.collidepoint(x, y): return bool Rect.collidepoint((x,y)): return bool test if a point is inside a rectangle
source code
 
colliderect(...)
Rect.colliderect(Rect): return bool test if two rectangles overlap
source code
 
contains(...)
Rect.contains(Rect): return bool test if one rectangle is inside another
source code
 
copy(...)
Rect.copy(): return Rect copy the rectangle
source code
 
fit(...)
Rect.fit(Rect): return Rect resize and move a rectangle with aspect ratio
source code
 
inflate(...)
Rect.inflate(x, y): return Rect grow or shrink the rectangle size
source code
 
inflate_ip(...)
Rect.inflate_ip(x, y): return None grow or shrink the rectangle size, in place
source code
 
move(...)
Rect.move(x, y): return Rect moves the rectangle
source code
 
move_ip(...)
Rect.move_ip(x, y): return None moves the rectangle, in place
source code
 
normalize(...)
Rect.normalize(): return None correct negative sizes
source code
 
union(...)
Rect.union(Rect): return Rect joins two rectangles into one
source code
 
union_ip(...)
Rect.union_ip(Rect): return None joins two rectangles into one, in place
source code
 
unionall(...)
Rect.unionall(Rect_sequence): return Rect the union of many rectangles
source code
 
unionall_ip(...)
Rect.unionall_ip(Rect_sequence): return None the union of many rectangles, in place
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]
  __safe_for_unpickling__
  bottom
  bottomleft
  bottomright
  center
  centerx
  centery
  h
  height
  left
  midbottom
  midleft
  midright
  midtop
  right
  size
  top
  topleft
  topright
  w
  width
  x
  y

Inherited from object: __class__

Method Details [hide private]

__delslice__(x, i, j)
(Slice deletion operator)

source code 

del x[i:j]

Use of negative indices is not supported.

__getslice__(x, i, j)
(Slicling operator)

source code 

x[i:j]

Use of negative indices is not supported.

__init__(...)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__

__new__(T, S, ...)

source code 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

__reduce__(...)

source code 

helper for pickle

Overrides: object.__reduce__
(inherited documentation)

__repr__(x)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__

__setslice__(x, i, j, y)
(Slice assignment operator)

source code 

x[i:j]=y

Use of negative indices is not supported.

__str__(x)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__