def __init__(self, xy, text, size, color=(0, 0, 0), font="calibri"): self.font = globs.getFont(font, size) self.color = color self.text = text self.draw() wh = self.renderedText.get_size() Sprite.__init__(self, xy, wh) self.image = self.renderedText
def draw(self): self.image.fill((255,0,255)) self.image.set_colorkey((255,0,255)) sign = pygame.image.load(globs.datadir+"/png/entities/sign.png").convert_alpha() self.image.blit(sign, (0,0)) signtopleft = (7,10) signbottomright = (93,70) font = globs.getFont("calibri", 12) for line, linetext in enumerate(self.text.split("\n")): renderedtext = font.render(linetext, True, pygame.color.Color(0, 0, 0)) self.image.blit(renderedtext, ((self.image.get_width()/2)-(renderedtext.get_width()/2),signtopleft[1]+3+(line*12)))