pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
Optimize Dirty Rects

Optimize Dirty Rects - 1.0

Jason Marshall (jmm0)

Tags:

Description

The script optimize_dirty_rects.py contains a function of the same name. This function will accept a list (or other iterable) of objects of the pygame.Rect type. All overlapping areas will be removed, and the function will return a list of Rect objects.

Do not pass in Rects that shouldn't be resized (e.g. Sprite.rect). Instead, pass in the Rects that are returned by a blit to the screen surface.

Example:
from optimize_dirty_rects import optimize_dirty_rects
# ...then, somewhere in the main loop...
    dirty = dirty_sprite_group.draw(screen)
    dirty = optimize_dirty_rects(dirty)
    pygame.display.update(dirty)

Bug reporting:
https://bitbucket.org/jmm0/optimize_dirty_rects/issues

This code is free (MIT License).

Links

Home Page: https://bitbucket.org/jmm0/optimize_dirty_rects
Source: https://bitbucket.org/jmm0/optimize_dirty_rects/downloads

Screenshot


click to view original size

Releases

Optimize Dirty Rects - 1.0 - Nov 9, 2013

Pygame.org account Comments

If you wish to leave a comment with your pygame.org account, please sign in first.

No user comments have been submitted.
spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
Oct 28, 2014

Oct 21, 2014

Oct 20, 2014

Oct 16, 2014

Oct 9, 2014

Oct 8, 2014

Oct 7, 2014

Oct 4, 2014

Oct 1, 2014

Sep 19, 2014

Sep 17, 2014

Sep 9, 2014

... more!
 
for pygame related questions, comments, and suggestions, please see help (lists, irc)