-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtextDisplayLeft.py
More file actions
28 lines (23 loc) · 882 Bytes
/
Copy pathtextDisplayLeft.py
File metadata and controls
28 lines (23 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from ctypes import alignment
from turtle import left
import pygame
import util
# title text class
class TextDisplayLeft():
def __init__(self, text_input, fontSize, x, y):
self.font = pygame.font.Font(
util.resourcePath('fonts/freesansbold.ttf'), fontSize)
self.white = (255, 255, 255)
self.blue = (0, 0, 128)
self.x_pos = x
self.y_pos = y
self.text_input = text_input
self.text = self.font.render(self.text_input, True, self.white)
self.textRect = self.text.get_rect(
topleft=(self.x_pos, self.y_pos))
def setText(self, newText):
self.text_input = newText
self.text = self.font.render(newText, True, self.white)
self.textRect = self.text.get_rect(topleft=(self.x_pos, self.y_pos))
def draw(self, surface):
surface.blit(self.text, self.textRect)