Hardware Reference
In-Depth Information
endOfLine = True
for test in range(0, wordsToUse): ;
# build up the line you want
useLine = useLine + words[test] + “ “
textSurface[segment] = font.render(useLine, ;
True, cText, cBackground )
newsLines[index] = newsLines[index][len(useLine) :]
if endOfLine : # work on the next line next time
index += 1
return index
def drawWords(index,offset) :
textRect = textSurface[index].get_rect()
textRect.centerx = screenWidth / 2
textRect.top = screenHeight - (textHeight * ;
index) - offset
if mirror :
screen.blit(pygame.transform.flip( ;
textSurface[index], True, False), textRect)
else :
screen.blit(textSurface[index], textRect)
def terminate(): # close down the program
print (“Closing down please wait”)
pygame.quit() # close pygame
sys.exit()
def checkForEvent(): # see if you need to quit
global scrollSize, pause, anymore, fName, mirror
event = pygame.event.poll()
if event.type == pygame.QUIT :
terminate()
if event.type == pygame.KEYDOWN :
if event.key == pygame.K_ESCAPE :
terminate()
if event.key == pygame.K_DOWN :
scrollSize -= 1
if scrollSize == 0:
scrollsize = 1
if event.key == pygame.K_UP :
scrollSize += 1
if event.key == pygame.K_SPACE :
pause = not pause
continued
Search WWH ::




Custom Search