Package icaro-bloques :: Module texto'
[hide private]
[frames] | no frames]

Source Code for Module icaro-bloques.texto'

 1  #!/usr/bin/python 
 2  # -*- coding: utf-8 -*- 
 3   
 4  # This program is free software: you can redistribute it and/or modify 
 5  # it under the terms of the GNU General Public License as published by 
 6  # the Free Software Foundation, either version 3 of the License, or 
 7  # (at your option) any later version. 
 8  # 
 9  # This program is distributed in the hope that it will be useful, 
10  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
11  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
12  # GNU General Public License for more details. 
13  import pygame 
14  #from os import system 
15  #from fondo import * 
16 -class Text:
17 - def __init__(self, fondo,FontName = None, FontSize = 20):
18 pygame.font.init() 19 self.font = pygame.font.Font(FontName, FontSize) 20 self.size = FontSize 21 self.fondo=fondo
22 - def render(self, text, color, pos):
23 #text = unicode(text, "UTF-8") 24 x, y = pos 25 for i in text.split("\r"): 26 self.fondo.screen.blit(self.font.render(i, 1, color), (x, y)) 27 y += self.size
28