pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
ScrollBuffer

ScrollBuffer - 0.1

Gummbum (gummbum)

Tags:

Description

(No image. It does what any tiler and scroller should do. Run scrollbuffer.py for a demo.)

ScrollBuffer is a scrolling buffer class for a tile-based renderer where tiles comprise a map that is larger than the screen.

This class is easy to use and much more efficient than re-tiling the screen every frame. It reduces calls to blit by using pygame's Surface.scroll() to scroll previously rendered pixels, and only renders tiles that emerge into view.

This concept came out of a discussion on the pygame-users mailing list. Since fast scrolling is the holy grail of Gummworld2 and a key desire of pytmxloader DR0ID and I wanted to explore it.

This is a work in progress that will likely be integrated into Gummworld2 once the best design is found. So far it is promising, delivering high framerates comparable to Gummworld2's tile collapsing trick, and has none of the downsides of concatenating tiles.

Links

Home Page: http://code.google.com/p/gummworld2/downloads/list
Source: http://code.google.com/p/gummworld2/downloads/list

Releases

ScrollBuffer - 0.1 - Aug 5, 2011

Pygame.org account Comments

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

July 21, 2012 8:52pm - j.k. - nickname: (capefeather)
It works fine for the example maps, but when I make a map in Tiled, main() just loads the bottommost layer. I've tried comparing maps I make to the example maps, but I don't see anything that could be causing this behaviour. Do I have to do something specific to make all the layers appear on the pygame screen?
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 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)