Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/devtools/CompleteTestKit/DrawableFontObject.py
blob: 56783f1f9a49d0fe2ac6888f443f3802d39066ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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, 1, (255,255,255))

        DrawableObject.__init__(self, [self.textImage], '', fps, x, y, xVelocity, yVelocity)

    def changeText(self, newText):

        self._images[0] = self.font.render(newText, True, (111,22,45))
        self.image = self._images[0]