I really appreciate your help.
The code you sent does work except that when I added
code to make the scrolling text repeat (it stays on
the same surface), it scrolls over the title.
How do I fix this?
I think with pygsear, I might just push the title up to
a higher layer (and probably add a background too...)
# scroller2a.py
import pygame
from pygsear.Drawable import String, Stationary, Layer, Image
from pygsear import Util
from pygsear.Game import Game
from pygsear.locals import TRANSPARENT, RED, BLUE
msg = """This is a very long message
which can contain newlines
and will be word wrapped automatically if the line \
gets to be too long to stay on one line like this one..."""
all = pygame.sprite.RenderUpdates()
x = 10
y = 0
for line in ['abcdefghijklmnopqrstuvwxyz',
'ABCDEFGHIJLMNOPQRSTUVWXYZ',
'abcdefghijklmnopqrstuvwxyz',
'ABCDEFGHIJLMNOPQRSTUVWXYZ']:
text_font = pygame.font.Font(None, 32)
text_rendered = text_font.render(line, 1, (255, 255, 255))
LineOfText(text_rendered, x, y, all)
y = y + 32
pygame.display.flip()
done = 0
while not done:
for event in pygame.event.get():
if event.type == QUIT:
done = 1
all.clear(screen, bg) # clear the roll surface
all.update()
d = all.draw(screen) # render all sprites (ie Text Lines) onto
roll_surface
pygame.display.update(d)