SDL_Rect style rectangle, enhanced ;


  • rect.normalize() -> None
  • - Fix negative width/height for this rect ;
  • rect.move(x, y) -> rect
  • - Returns a rect moved by the given offset ;
  • rect.inflate(x, y) -> rect
  • - Returns a rect with the dimensions changed by the arguments (from center). ;
  • rect.union(rectstyle) -> rect
  • - Returns a rectangle surrounding both rectangles. ;
  • rect.collidepoint(x, y) -> int
  • - Returns true if the given position is inside the rect (inclusive) ;
  • rect.colliderect(rectstyle) -> rect
  • - Returns true if rectangles overlap. ;
  • rect.colliderect(rectstyle list) -> int index
  • - Returns first index of rectangle that intersects from a list. -1 if no intersections. ;
  • rect.colliderectall(rectstyle list) -> int index
  • - Returns list of all indexes of rects intersecting. ;
  • rect.clip(rectstyle) -> rect
  • - Returns a rect of the overlapping area between rects. 0 width/height if not touching. ;
  • rect.contains(rectstyle) -> int
  • - Returns true if rect completely surrounds given rect. ;
  • rect.clamp(rectstyle) -> rect
  • - Returns rect moved to be contained in given rectangle. ;


    rect.normalize() -> None


    rect.move(x, y) -> rect


    rect.inflate(x, y) -> rect


    rect.union(rectstyle) -> rect


    rect.collidepoint(x, y) -> int


    rect.colliderect(rectstyle) -> rect


    rect.colliderect(rectstyle list) -> int index


    rect.colliderectall(rectstyle list) -> int index


    rect.clip(rectstyle) -> rect


    rect.contains(rectstyle) -> int


    rect.clamp(rectstyle) -> rect