Width and height are managed dynamically: we can almost freely resize the window

This commit is contained in:
Yohann D'ANELLO
2020-11-09 00:44:08 +01:00
parent 0ab0e6a00c
commit e9c8640159
6 changed files with 48 additions and 16 deletions

View File

@ -10,8 +10,6 @@ from dungeonbattle.interfaces import Map
class MapDisplay(Display):
def __init__(self, screen: Any, m: Map, player: Player, pack: TexturePack):
super().__init__(screen)
self.height = self.rows
self.width = self.cols
self.pack = pack
self.map = m
self.player = player
@ -38,4 +36,5 @@ class MapDisplay(Display):
self.pad.refresh(pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol)
def refresh(self) -> None:
self.ensure_resized(self.pad)
return self.display(self.player.y, self.player.x)