Esempio n. 1
0
    def setFont(self, fontSize, color, fontType):
        self.color = color
        self.fontType = fontType

        # if hasattr(sys, '_MEIPASS'):
        self.fontType = utility.getResourcePath(fontType)

        self.fontSize = fontSize
        self.buildImage()
Esempio n. 2
0
    def __init__(self, fontType, fontSize=12, color=(0, 0, 0), text="", lifeTimer=-1, textIndex=0):
        pygame.sprite.Sprite.__init__(self)
        pygame.font.init()

        self.textIndex = textIndex
        self.text = text
        self.color = color
        self.fontType = fontType

        # if hasattr(sys, '_MEIPASS'):
        self.fontType = utility.getResourcePath(fontType)

        self.fontSize = fontSize
        self.lifeTimer = lifeTimer
        self.alignment = TOP_LEFT
        self.buildImage()
        self.position = vector.vector2d(0, 0)
Esempio n. 3
0
    def __init__(self, fontType, fontSize, color, text):
        # if hasattr(sys, '_MEIPASS'):
        fontType = utility.getResourcePath(fontType)

        fontObject = pygame.font.Font(fontType, fontSize)
        self.image = fontObject.render(str(text), ANTI_ALIAS, color)