def __init__(self):
super(MenuScene, self).__init__()
- self.widgets.append(TextWidget((10, 10), 'Haai',
+ self.widgets.append(TextWidget((10, 10), 'Haai', fontsize=32,
colour=(255, 255, 255)))
def handle_event(self, ev):
+import pygame
+
from naja.constants import FONT, FONT_SIZE
from naja.widgets.base import Widget
from naja.resources import resources
self.text = text
self.fontname = fontname or FONT
- self.fontsize = fontsize or FONT_SIZE
+ self.fontsize = (fontsize or FONT_SIZE) / 2
self.colour = colour or (0, 0, 0)
def prepare(self):
self.font = resources.get_font(self.fontname, self.fontsize)
- self.surface = self.font.render(self.text, True, self.colour)
+ text = self.font.render(self.text, True, self.colour)
+ text_rect = text.get_rect()
+ self.surface = pygame.transform.scale(text, (text_rect.width * 2,
+ text_rect.height * 2))
self.size = self.surface.get_rect().size
def draw(self, surface):