Akció panel

This commit is contained in:
markojozsef
2026-10-17 14:53:30 +02:00
parent 6632344afe
commit f26964e697
2 changed files with 15 additions and 5 deletions

View File

@@ -12,11 +12,12 @@ class Character:
self.display = display # Egy függvény amely akkor fut le amikor a speciális karaktert megjelenítik
class TextRenderer:
def __init__(self, x, y, width=None):
def __init__(self, x, y, width=None, center=False):
self.sprites = []
self.base_x = x
self.base_y = y
self.width = width
self.center = center
self.text = ""
self.textptr = 0
self.x = x
@@ -56,7 +57,8 @@ class TextRenderer:
self.y + char.y_offset,
char.width,
12
)
),
char.width
])
self.x += char.width
@@ -78,10 +80,11 @@ class TextRenderer:
pass
def render(self):
offset = -(sum(s[2] for s in self.sprites) // 2) if self.center else 0
for s in self.sprites:
arcade.draw_texture_rect(
s[0],
s[1],
s[1].move(offset, 0),
pixelated=True
)