Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/devtools/CompleteTestKit/DrawableFontObject.py
blob: be86a3fd1985823558de38b31bf0a6ad2eadd148 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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))
        self._image = self.textImage
        DrawableObject.__init__(self, [self.textImage], '', fps, x, y, xVelocity, yVelocity)

    def changeText(self, newtext):

        self._images[0] = font.render(newText, True, (0,0,0))