import pygame
import os

from pytmx import pytmx
from pygame.locals import *
from tileset import Tileset
from player import Player

def drawtext():        
    font = pygame.font.Font(None,17)
    text= font.render(" M i s s i o n",True,(255,255,255))
    textRect = text.get_rect()
    textRect.right = screen.get_rect().right
    textRect.right = screen.get_rect().right
    main.screen.blit(text, textRect)

def main():
    pygame.init()
    screen = pygame.display.set_mode((1024, 768), HWSURFACE|DOUBLEBUF)
    tileset = Tileset("../assets/maps/test.tmx")
    walls = tileset.get_walls()
    player = Player((32, 32), 1)
    player.set_walls(walls)
    clock = pygame.time.Clock()
    allsprites = pygame.sprite.RenderPlain((player))
    

    while 1:
        clock.tick(60)
        for e in pygame.event.get():
            if e.type == QUIT:
                return
        key = pygame.key.get_pressed()
        if key[pygame.K_w]:
            player.move_forward()
        if key[pygame.K_s]:
            player.move_backwards()
        if key[pygame.K_a]:
            player.move_left()
        if key[pygame.K_d]:
            player.move_right()
        
        allsprites.update()
        tileset.render(screen)
        allsprites.draw(screen)
        drawtext()
        pygame.display.flip()
        pygame.display.update()
    

    
if __name__ == "__main__": main()
@@ -142,273 +142,584 @@
 ext(
-):        %0A    font = pygame.font.Font(None,17)%0A    text= font.render(%22 M i s s i o n%22,True,(255,255,255))%0A    textRec
+font, text, screen, color=(255,255,255), bg=(0,0,0),):%0A    lines = text.splitlines()%0A    #first we need to find image size...%0A    width = height = 0%0A    for l in lines:%0A        width = max(width, font.size(l)%5B0%5D)%0A        heigh
 t 
++
 = 
-tex
+fon
 t.get_
-rect()%0A    textRect.right = screen.get_rect().right%0A    textRect.right = screen.get_rect().right%0A    main.screen.blit(text, textRect)%0A
+linesize()%0A    #create 8bit image for non-aa text..%0A    img = pygame.Surface((width, height), 0, 8)%0A    img.set_palette(%5Bbg, color%5D)%0A    #render each line%0A    height = 0%0A    for l in lines:%0A        t = font.render(l, 0, color, bg)%0A        img.blit(t,( width -font.size(l)%5B0%5D), height)%0A        height += font.get_linesize()%0A        %0A    
 %0Adef
@@ -1577,16 +1577,31 @@
 rawtext(
+None, 'hello',5
 )%0A      

multiple lines of text