ecs #58
|
@ -3,6 +3,7 @@ Un plugin permettant d'afficher du texte à l'écran.
|
|||
"""
|
||||
|
||||
|
||||
from turtle import position
|
||||
import pygame
|
||||
|
||||
from engine import GlobalPlugin
|
||||
|
@ -22,11 +23,13 @@ class Text:
|
|||
text: str,
|
||||
size: int = 50,
|
||||
color: pygame.Color = pygame.Color(255, 255, 255),
|
||||
position: Vec2 = Vec2(0),
|
||||
origin: Vec2 = Vec2(0),
|
||||
):
|
||||
self.text = text
|
||||
self.size = size
|
||||
self.color = color
|
||||
self.position = position
|
||||
self.origin = origin
|
||||
|
||||
|
||||
|
@ -44,6 +47,8 @@ def __render_texts(world: World):
|
|||
entity[Sprite].texture = texture
|
||||
else:
|
||||
entity[Sprite] = Sprite(texture)
|
||||
entity[Sprite].position = text.position
|
||||
entity[Sprite].origin = text.origin
|
||||
|
||||
|
||||
PLUGIN = GlobalPlugin(
|
||||
|
|
Loading…
Reference in a new issue