def __init__(self, game): """The class contructor, which creates a new Main Menu. Args: game: The game which the menu is attached to. This is passed to the constructor of the Menu superclass. """ Menu.__init__(self, game) self.state = "2"
def __init__(self, game): """The class contructor, which creates a new Main Menu. Args: game: The game which the menu is attached to. This is passed to the constructor of the Menu superclass. """ Menu.__init__(self, game) self.state = "Solve" mid_width, mid_height = self.renderer.display_width / 2, self.renderer.display_height / 2 self.solvex, self.solvey = mid_width, mid_height + 30 self.createx, self.createy = mid_width, mid_height + 50 self.cursor_rect.midtop = (self.solvex + self.offset, self.solvey)
def __init__(self, game): """The class contructor, which creates a new Main Menu. Args: game: The game which the menu is attached to. This is passed to the constructor of the Menu superclass. """ Menu.__init__(self, game) self.state = "0" self.lab_selection = [] j = 0 while j < len(self.game.labs): self.lab_selection.append(self.game.labs[j:j + 3]) j += 3 self.page = 0 mid_width, mid_height = self.renderer.display_width / 2, self.renderer.display_height / 2 self.firstx, self.firsty = mid_width, mid_height self.secondx, self.secondy = mid_width, mid_height + 30 self.thirdx, self.thirdy = mid_width, mid_height + 60 self.cursor_rect.midtop = (self.firstx + self.offset, self.firsty)
def __init__(self, menu_type, options, char=None): '''BattleMenu class constructor. args: menu_type: str; type of the menu (main, skill, magic or item) options: lst; options to choose from; used to create the menu buttons char: Character object; needed for creating item buttons ''' gutter = SCREEN_W // 64 w = SCREEN_W // 3 - gutter h = SCREEN_H // 4 self.menu_type = menu_type Menu.__init__(self, options, gutter, w, h) self._cursor_pos = [] self._create_bm_buttons(options, char) if self._cursor_pos: self._cursor = MenuCursor() self._cursor_current = self._cursor_pos[0] else: self._cursor = False self._cursor_current = None