Updated pygame version to 2.3.0
parent
bde2b83070
commit
925b4c208a
|
@ -12,7 +12,6 @@ from sprite.Sprite import Sprite
|
||||||
from sprite.StaticSprite import StaticSprite
|
from sprite.StaticSprite import StaticSprite
|
||||||
from ui_elements.TextLabel import TextLabel
|
from ui_elements.TextLabel import TextLabel
|
||||||
|
|
||||||
|
|
||||||
what_to_run = 'textlabel'
|
what_to_run = 'textlabel'
|
||||||
|
|
||||||
if what_to_run == 'level':
|
if what_to_run == 'level':
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import pygame
|
import pygame
|
||||||
from pygame.examples.textinput import Screen
|
from pygame import Surface
|
||||||
from pygame.font import Font
|
from pygame.font import Font
|
||||||
|
|
||||||
from sprite.PositionScale import PositionScale
|
from sprite.PositionScale import PositionScale
|
||||||
|
@ -18,7 +18,7 @@ class TextLabel:
|
||||||
self.font = font
|
self.font = font
|
||||||
self.position_scale = PositionScale()
|
self.position_scale = PositionScale()
|
||||||
|
|
||||||
def draw(self, screen: Screen, screen_transform: PositionScale):
|
def draw(self, screen: Surface, screen_transform: PositionScale):
|
||||||
rendered_font = self.font.render(str(self.text), True, (255, 255, 255))
|
rendered_font = self.font.render(str(self.text), True, (255, 255, 255))
|
||||||
self.current_width = rendered_font.get_width()
|
self.current_width = rendered_font.get_width()
|
||||||
self.current_height = rendered_font.get_height()
|
self.current_height = rendered_font.get_height()
|
||||||
|
|
Loading…
Reference in New Issue