L3-Bataille-Navale/source/gui/widget/base/Label.py
2023-02-09 18:26:03 +01:00

15 lines
373 B
Python

from typing import Optional
import pyglet.text
class Label(pyglet.text.Label):
"""
Similar to the pyglet Label, but allow to update the size from a function
"""
def update_size(self, x: int, y: int, width: Optional[int] = None, height: Optional[int] = None):
self.x = x
self.y = y
self.width = width
self.height = height