Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/devtools/Dave's Test Kit/DrawableFontObject.py
blob: 425d57261ce9f8c304fd28e2812c9be6cfdcf1fb (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, x = 0, y = 0):

        self.font = font
        self.textImage = font.render(text, 1, (255,255,255))
        #self._image = self.textImage
        DrawableObject.__init__(self, [self.textImage], '')

    def changeText(self, newText, color=(255,255,255)):

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