1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
import pygame
from DrawableObject import DrawableObject
class DrawableFontObject(DrawableObject, pygame.sprite.Sprite):
def __init__(self,text,font,fps = 10, x = 0, y = 0, xVelocity = 0, yVelocity = 0):
self.font = font
self.textImage = font.render(text, True, (0,0,0))
DrawableObject.__init__(self, [self.textImage], '', fps, x, y, xVelocity, yVelocity)
def changeText(self, newtext):
self._images[0] = font.render(newText, True, (0,0,0))
|