ecs #58

Merged
raphael merged 70 commits from ecs into main 2023-11-03 15:29:36 +00:00
Showing only changes of commit 66c912bce0 - Show all commits

View file

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