Python graphics question:pixel scrolling
Diez B. Roggisch
deets at nospam.web.de
Fri Aug 29 12:59:53 EDT 2008
Raymond Luxury-Yacht wrote:
> To learn python, I've been trying to write a simple graphics program
> which displays a 1D cellular automaton's evolution. The last time I
> wrote this program, it was in C for a CGA adaptor (!) in which the
> display was mapped to two interlaced blocks of memory, and scrolling
> up two lines of pixels was very simple and very smooth. The code
> below works, and uses pygame for the graphics. But the scrolling is
> quite flickery when using large windows. I'm sure that the code
> contains various neophyte python errors, and I'd appreciate any
> comments on that, but my main question is how I ought to have coded it
> in order to have the scrolling be smooth. I did see a comment on a
> pygame site saying that pygrame should not be used for side-scrollers,
> to which this is similar. Is there a better way with python?
You need to to double-buffering. Just as in the old days...
http://www.pygame.org/docs/tut/intro/intro.html
Look for pygame.display.flip()
Diez
More information about the Python-list
mailing list