def __init__(self, gamestates): Menu.__init__(self, gamestates, 4, 0) # 0 - quit self.add_list([ MenuTextButton('Play', 30, Coordinates(10, 15), Coordinates(325, 50), self.click_play, scale=Coordinates(1.5, 1)), MenuTextButton('Characters', 30, Coordinates(10, 15), Coordinates(325, 110), self.click_character_select, scale=Coordinates(1.5, 1)), MenuTextButton('Settings', 30, Coordinates(10, 15), Coordinates(325, 170), self.click_settings, scale=Coordinates(1.5, 1)), MenuTextButton('Credits', 30, Coordinates(10, 15), Coordinates(325, 230), self.click_credits, scale=Coordinates(1.5, 1)), MenuTextButton('Quit', 30, Coordinates(10, 15), Coordinates(325, 290), self.click_quit, scale=Coordinates(1.5, 1)), Background('resources\\test_images\\white_background.png') ])
def __init__(self, gamestates): Menu.__init__(self, gamestates, 3, 1) # 1 - build mode self.add(self.change_perspective, 1 / 1) self.add(self.focus, 1 / target_fps) self.add_list([MenuTextButton('Resume', 30, Coordinates(10, 15), Coordinates(50, 50), self.click_resume, scale=Coordinates(1.5, 1)), MenuTextButton('Main Menu', 30, Coordinates(10, 15), Coordinates(50, 110), self.click_main_menu, scale=Coordinates(1.5, 1))])
def __init__(self, gamestates): Menu.__init__(self, gamestates, 12, 11) self.add_list([MenuTextButton('Back', 30, Coordinates(10, 15), Coordinates(10, 10), self.click_back), MenuTextButton('Previous', 30, Coordinates(10, 15), Coordinates(580, 540), self.click_previous), MenuTextButton('Next', 30, Coordinates(10, 15), Coordinates(690, 540), self.click_next), Background('resources\\test_images\\white_background.png')]) self.buttons = [] self.c = 0 self.s = 12 self.binding_list = None
def __init__(self, gamestates): Menu.__init__(self, gamestates, 6, 5) # 0 - quit self.add_list([ MenuTextButton('Back', 30, Coordinates(10, 15), Coordinates(10, 10), self.click_back), MenuTextButton('Previous', 30, Coordinates(10, 15), Coordinates(580, 540), self.click_previous), MenuTextButton('Next', 30, Coordinates(10, 15), Coordinates(690, 540), self.click_next), Background('resources\\test_images\\white_background.png') ]) self.buttons = [] self.c = 0 self.s = 18 self.paths = self.get_level_paths()
def __init__(self, gamestates): Menu.__init__(self, gamestates, 8, 4) self.add_list([ MenuTextButton('Back', 30, Coordinates(10, 15), Coordinates(10, 10), self.click_back), MenuTextButton('Previous', 30, Coordinates(10, 15), Coordinates(580, 540), self.click_previous), MenuTextButton('Next', 30, Coordinates(10, 15), Coordinates(690, 540), self.click_next), Background('resources\\test_images\\white_background.png') ]) self.characters = [] self.buttons = [] self.c = 0 self.s = 12 self.name_label = None self.character_names = self.get_all_characters()
def __init__(self, gamestates): Menu.__init__(self, gamestates, 7, 6) self.add_list([ MenuTextButton('Play', 30, Coordinates(10, 15), Coordinates(500, 50), self.click_play), MenuTextButton('Edit', 30, Coordinates(10, 15), Coordinates(500, 110), self.click_edit), MenuTextButton('Rename', 30, Coordinates(10, 15), Coordinates(500, 170), self.click_rename), MenuTextButton('Delete', 30, Coordinates(10, 15), Coordinates(500, 230), self.click_delete), MenuTextButton('Back', 30, Coordinates(10, 15), Coordinates(500, 290), self.click_back), Background('resources\\test_images\\white_background.png') ]) self.path = None self.name_label = None
def __init__(self, gamestates): Menu.__init__(self, gamestates, 10, 6) self.add_list([ MenuTextButton('Back', 30, Coordinates(10, 15), Coordinates(325, 500), self.click_back, scale=Coordinates(1.5, 1)), Background('resources\\test_images\\green_background.png') ])
def __init__(self, gamestates): Menu.__init__(self, gamestates, 14, 4) self.add_list([ MenuTextButton('Back', 30, Coordinates(10, 15), Coordinates(10, 10), self.click_back), LevelName(Menu_14.credit_string, 40, Coordinates(100, 100)), LevelName(Menu_14.mentor, 40, Coordinates(100, 150)), LevelName(Menu_14.adiitional_design, 30, Coordinates(100, 300)), LevelName(Menu_14.beta_testers, 30, Coordinates(100, 350)), LevelName(Menu_14.special_thx, 30, Coordinates(100, 400)), LevelName(Menu_14.special_thx2, 30, Coordinates(100, 430)), Background('resources\\test_images\\white_background.png') ])
def __init__(self, gamestates): Menu.__init__(self, gamestates, 5, 4) self.add_list([ MenuTextButton('Build', 30, Coordinates(10, 15), Coordinates(325, 50), self.click_build, scale=Coordinates(1.5, 1)), MenuTextButton('Level Select', 30, Coordinates(10, 15), Coordinates(325, 110), self.click_lselect, scale=Coordinates(1.5, 1)), MenuTextButton('Main Menu', 30, Coordinates(10, 15), Coordinates(325, 170), self.click_main_menu, scale=Coordinates(1.5, 1)), Background('resources\\test_images\\white_background.png') ])
def __init__(self, gamestates): Menu.__init__(self, gamestates, 11, 4) self.add_list([ MenuTextButton('User Settings', 30, Coordinates(10, 15), Coordinates(325, 50), self.click_us, scale=Coordinates(1.5, 1)), MenuTextButton('Key Bindings', 30, Coordinates(10, 15), Coordinates(325, 110), self.click_keyb, scale=Coordinates(1.5, 1)), MenuTextButton('Back', 30, Coordinates(10, 15), Coordinates(325, 170), self.click_back, scale=Coordinates(1.5, 1)), Background('resources\\test_images\\white_background.png') ])
def generate_buttons(self, arr, starting_index, finishing_index): if starting_index >= len(arr): yield False if finishing_index > len(arr): finishing_index = len(arr) l = arr[starting_index:finishing_index] g = self.generate_coordinates() for i in l: c = next(g) if c: yield MenuTextButton( i.split('\\')[-1][:-4], 30, Coordinates(10, 15), c, self.get_level_function(i), self.dim / Coordinates(100, 50)) else: yield False yield False
def generate_buttons(self, arr, starting_index, finishing_index): if starting_index >= len(arr): yield False if finishing_index > len(arr): finishing_index = len(arr) l = arr[starting_index: finishing_index] g = self.generate_coordinates() for i in l: c = next(g) if c: n = LevelName(i.name, 30, c + Coordinates(0, 15)) b = MenuTextButton(i.key.get_name(), 30, Coordinates(10, 15), c + (self.dim - self.dim_button) * Coordinates(1, 0), self.get_binding_function(i.name), self.dim_button / Coordinates(100, 50)) yield n, b else: yield False yield False
def __init__(self, gamestates): Menu.__init__(self, gamestates, 13, 11) self.add_list([MenuTextButton('Back', 30, Coordinates(10, 15), Coordinates(10, 10), self.click_back), Background('resources\\test_images\\white_background.png')]) self.mouse_confined_button = MenuTextButton('', 30, Coordinates(10, 15), Coordinates(300, 50), self.confine, Coordinates(2, 1))