Refactored the height/width members of displays and actors from integers to methods that compute based on the type of display (e.g., a text object is differently sized in curses than on gtk or whatever)

This commit is contained in:
2013-12-15 10:30:30 -05:00
parent c56e0e963d
commit 2265107d6e
3 changed files with 38 additions and 13 deletions

View File

@@ -43,7 +43,7 @@ class Game(event.EventHandler, registry.Registerable):
self.__players__.append(player.Player(registryKey='player1'))
self.__players__.append(player.Player(registryKey='player2'))
self.__players__[1].x = (self.__display__.width - self.__players__[1].width - 1)
self.__players__[1].x = (self.__display__.width() - self.__display__.width(self.__players__[1]) - 1)
logger = logging.getLogger()
logger.debug("Adding actors {} and {}".format(self.__players__[0].uuid, self.__players__[1].uuid))
self.__display__.addActor(self.__players__[0])