forked from s464965/WMICraft
13 lines
421 B
Python
13 lines
421 B
Python
|
import pygame
|
||
|
|
||
|
|
||
|
def draw_text(text, color, surface, x, y, text_size=30, is_bold=False):
|
||
|
if is_bold:
|
||
|
font = pygame.font.Font('resources/fonts/Poppins-SemiBold.ttf', text_size)
|
||
|
else:
|
||
|
font = pygame.font.Font('resources/fonts/Poppins-Regular.ttf', text_size)
|
||
|
textobj = font.render(text, 1, color)
|
||
|
textrect = textobj.get_rect()
|
||
|
textrect.topleft = (x, y)
|
||
|
surface.blit(textobj, textrect)
|