def draw(self, surf = None): txt = scale_surf(font_to_bitmap( str(self.text) , \ self.font_size , self.fg, self.bg, self.font, \ self.antialias), self.get_scale()) txt.set_colorkey(self.bg) if surf == None: self.get_screen().blit(txt, (self.x,self.y))
def draw(self): wo = self.get_worldoffset() scale = self.get_scale() cx = 0 cy = 0 wc = 0 txt_size = self.font_size txt = self.text.split() for i in txt: a = font_to_bitmap(i+' ', txt_size,(0,0,0),(255,255,255)) a = scale_surf(a, self.get_scale()) location = ((self.topleft[0]* scale) + cx + wo[0], (self.topleft[1]* scale) + cy + wo[1]) self.get_screen().blit(a, location) if wc < self.words_per_line: cx = cx+ a.get_width() wc +=1 else: wc=0 cx = 0 cy = cy+a.get_height()