Width and height are managed dynamically: we can almost freely resize the window
This commit is contained in:
@ -5,15 +5,13 @@ from dungeonbattle.entities.player import Player
|
||||
|
||||
|
||||
class StatsDisplay(Display):
|
||||
def __init__(self, screen: Any, player: Player, height: int, width: int,
|
||||
def __init__(self, screen: Any, player: Player,
|
||||
topleftx: int, toplefty: int):
|
||||
super().__init__(screen)
|
||||
self.width = width
|
||||
self.height = height
|
||||
self.topleftx = topleftx
|
||||
self.toplefty = toplefty
|
||||
self.player = player
|
||||
self.pad = self.newpad(height, width)
|
||||
self.pad = self.newpad(self.height, self.width)
|
||||
|
||||
def update_pad(self) -> None:
|
||||
string = ""
|
||||
@ -37,6 +35,7 @@ class StatsDisplay(Display):
|
||||
self.pad.addstr(2, 0, string3)
|
||||
|
||||
def refresh(self) -> None:
|
||||
self.ensure_resized(self.pad)
|
||||
self.pad.clear()
|
||||
self.update_pad()
|
||||
self.pad.refresh(0, 0, self.toplefty, self.topleftx,
|
||||
|
Reference in New Issue
Block a user