Hardware Reference
In-Depth Information
background = pygame.Surface((screenWidth,screenHeight))
segments = 4
segment = 0 # initial start place
textHeight = screenHeight / segments
textSurface = [ pygame.Surface((screenWidth,textHeight)) ;
for s in range(0,segments+1)]
# define the colours to use for the user interface
cBackground =(0,0,0)
cText = (255,255,255)
scrollSize = 6
background.fill(cBackground) # make background colour
font = pygame.font.Font(None, textHeight)
numberOfLines = 0
newsLines = list()
fName = “news.txt” # name of file to use
mirror = False
pause = False
anymore = False
def main():
global anymore
while True :
getNews()
lines = 0
while lines < numberOfLines :
for i in range(segments, 0, -1): ;
# shuffle up the text boxes
textSurface[i] = textSurface[i-1]
lines = setWords(lines,0)
offset = 0
while offset < textHeight:
checkForEvent()
if not pause :
drawScreen(offset)
offset += scrollSize
anymore = False
while not anymore :
checkForEvent()
def getNews(): # open news file
global numberOfLines, newsLines
continued
Search WWH ::




Custom Search