I've been attempting to develop a text adventure type game in Python (and PyGame), and thus needed a module to repeatedly blit text to the screen. After searching through a few, I downloaded KTextSurfaceWriter and installed it. Then I tried to follow the demo in the text provided here (http://www.pygame.org/project-KTextSurfaceWriter-1001-.html)
My code:
from ktextsurfacewriter import KTextSurfaceWriter
import pygame
from pygame.locals import *
import pygame.font
pygame.font.init()
screen = pygame.display.set_mode((640,480), 0, 32)
surface = pygame.surface ( (400, 400), flags = SRCALPHA, depth = 32)
surface.fill( (255,255,255,255) )
def blitSurface():
screen.blit(surface, (50,50) )
pygame.display.update()
blitSurface()
def waitForUserAction():
while True:
for event in pygame.event.get():
if event.type == QUIT:
import sys
sys.exit()
if event.type == KEYDOWN:
return
waitForUserAction()
However, this throws back the module error at line 9. I'm fairly new to Python and most of the solutions I saw for this issue involved using the 'from [module] import' code that I already have at the beginning.