Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/MAFH2/fortuneengine/DrawableFontObject.py
blob: 92f641f62be926879b4c64e76dbd96b1e20f8aee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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.text = text
        DrawableObject.__init__(self, [self.textImage], '')

    def changeText(self, newText, color=(0,0,0)):
        self.text = newText
        self._images[0] = self.font.render(str(newText), True, color)
        self.image = self._images[0]
    
    def getText(self):
        return str(self.text)