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
Jan 24, 2015

Jan 20, 2015



Jan 15, 2015

Jan 14, 2015


Jan 7, 2015

Jan 4, 2015


Dec 30, 2014

Dec 14, 2014

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