def __init__(self, window): View.__init__(self, window) x = ActionsView.GUTTER y = ActionsView.GUTTER width = window.width - ActionsView.GUTTER*2 height = window.height - ActionsView.GUTTER*2 layer = ActionsLayer(x, y, width, height) self.layers.append(layer)
def __init__(self, window): View.__init__(self, window) x = TraitsView.GUTTER y = TraitsView.GUTTER width = window.width - TraitsView.GUTTER*2 height = window.height - TraitsView.GUTTER*2 layer = TraitsLayer(x, y, width, height) self.layers.append(layer)
def __init__(self, window): ''' Constructor ''' View.__init__(self, window) x = PropertiesView.GUTTER y = PropertiesView.GUTTER width = window.width - PropertiesView.GUTTER*2 height = window.height - PropertiesView.GUTTER*2 layer = PropertiesLayer(x, y, width, height) self.layers.append(layer)
def __init__(self, window): View.__init__(self, window) x = InventoryView.GUTTER y = InventoryView.GUTTER width = 380 height = window.height - InventoryView.GUTTER*2 layer = EquipmentLayer(x, y, width, height) self.layers.append(layer) x = width + InventoryView.GUTTER*2 + 15 width = 400 layer = InventoryLayer(x, y, width, height) self.layers.append(layer)
def __init__(self, window): ''' Constructor ''' View.__init__(self, window) select_x = WorldView.GUTTER select_y = WorldView.GUTTER select_width = 180 select_height = (window.height - WorldView.GUTTER*3 / 2) layer = FloorSelectLayer(select_x, select_y, select_width, select_height) self.layers.append(layer) info_y = WorldView.GUTTER layer = FloorInfoLayer(select_x, info_y, select_width, select_height) self.layers.append(layer) display_x = select_x + select_width + WorldView.GUTTER display_width = window.width - select_width - WorldView.GUTTER*2 display_height = window.height - WorldView.GUTTER*2 layer = FloorDisplayLayer(display_x, select_y, display_width, display_height) self.layers.append(layer)
def __init__(self, window): ''' Constructor ''' View.__init__(self, window)
def __init__(self, window, ascii=True): View.__init__(self, window) # Create the log window log_x = GameView.LOWER_BAR_GUTTER_X log_y = GameView.LOWER_BAR_GUTTER_Y log_width = (window.width / 3) - GameView.LOWER_BAR_GUTTER_X*3/2 log_height = GameView.LOWER_BAR_HEIGHT - GameView.LOWER_BAR_GUTTER_Y*2 log_layer = Log(log_x, log_y, log_width, log_height) self.layers.append(log_layer) # Create the inventory window inv_x = log_width + GameView.LOWER_BAR_GUTTER_X*2 inv_width = ((window.width - log_width) / 3) - GameView.LOWER_BAR_GUTTER_X*3/2 inv_layer = Inventory(inv_x, log_y, inv_width, log_height) self.layers.append(inv_layer) # Create the stances window stance_x = inv_x + inv_width + GameView.LOWER_BAR_GUTTER_X stance_layer = Actions(stance_x, log_y, inv_width, log_height) self.layers.append(stance_layer) # Create the actions window act_x = stance_x + inv_width + GameView.LOWER_BAR_GUTTER_X act_layer = Actions(act_x, log_y, inv_width, log_height) self.layers.append(act_layer) # Create the info window info_x = window.width - (GameView.INFO_WIDTH + GameView.INFO_GUTTER_X*2) info_y = window.height - (GameView.INFO_HEIGHT + GameView.INFO_GUTTER_Y) info_width = GameView.INFO_WIDTH info_height = GameView.INFO_HEIGHT info_layer = PlayerCard(info_x, info_y, info_width, info_height) self.layers.append(info_layer) # Create the effects list effects_x = window.width - (GameView.INFO_WIDTH + GameView.INFO_GUTTER_X*2) effects_y = GameView.LOWER_BAR_HEIGHT effects_width = GameView.INFO_WIDTH effects_height = window.height - GameView.LOWER_BAR_HEIGHT - GameView.INFO_GUTTER_Y*2 - info_height effects_layer = Effects(effects_x, effects_y, effects_width, effects_height) self.layers.append(effects_layer) # Create the command bar cmd_x = GameView.COMMAND_BAR_GUTTER_X cmd_y = GameView.LOWER_BAR_HEIGHT cmd_width = info_x - GameView.INFO_GUTTER_X - GameView.COMMAND_BAR_GUTTER_X*2 cmd_height = GameView.COMMAND_BAR_HEIGHT + GameView.LOWER_BAR_GUTTER_Y cmd_layer = CommandBar(cmd_x, cmd_y, cmd_width, cmd_height) self.layers.append(cmd_layer) # Create the main game window game_x = 0 game_y = GameView.LOWER_BAR_HEIGHT + cmd_height game_width = info_x - GameView.INFO_GUTTER_X game_height = window.height - log_height - cmd_height if ascii is True: game_layer = AsciiGame(game_x, game_y, game_width, game_height) else: game_layer = TileGame(game_x, game_y, game_width, game_height) self.layers.append(game_layer)