def __init__(self): # call superclass with the title super(MainMenu, self).__init__("GROSSINI'S SISTERS") pyglet.font.add_directory('.') # you can override the font that will be used for the title and the items self.font_title['font_name'] = 'You Are Loved' self.font_title['font_size'] = 72 self.font_item['font_name'] = 'You Are Loved' self.font_item_selected['font_name'] = 'You Are Loved' # you can also override the font size and the colors. see menu.py for # more info # example: menus can be vertical aligned and horizontal aligned self.menu_valign = CENTER self.menu_halign = CENTER items = [] items.append(MenuItem('New Game', self.on_new_game)) items.append(MenuItem('Options', self.on_options)) items.append(MenuItem('Scores', self.on_scores)) items.append(MenuItem('Quit', self.on_quit)) self.create_menu(items, zoom_in(), zoom_out())
def __init__(self): # call superclass with the title super(MenuPrincipal, self).__init__("REVERSI !") pyglet.font.add_directory('.') # you can override the font that will be used for the title and the itens self.font_title['font_name'] = 'Blood Of Dracula' self.font_title['font_size'] = 72 self.font_title['color'] = (255, 16, 16, 255) self.font_item['font_name'] = 'You Are Loved' self.font_item_selected['font_name'] = 'Blood Of Dracula' self.font_item_selected['color'] = (255, 0, 0, 255) self.menu_valign = CENTER self.menu_halign = CENTER itens = [] itens.append(MenuItem('Novo Jogo', self.on_start)) itens.append(MenuItem('Opcoes', self.on_options)) itens.append(MenuItem('Creditos', self.on_credits)) itens.append(MenuItem('Sair', self.on_quit)) self.create_menu(itens, zoom_in(), zoom_out())
def __init__(self): super(MainMenu, self).__init__() self.menu_valign = CENTER self.menu_halign = CENTER self.font_title['font_name'] = 'Prototype' self.font_title['font_size'] = 42 self.font_item['font_name'] = 'Prototype' self.font_item_selected['font_name'] = 'Prototype' self.font_item['font_size'] = 20 self.font_item_selected['font_size'] = 20 self.title_label = "Menu" items = [] saves = list_saves() if os.path.exists('save'): num_saves = len(saves) else: num_saves = 0 # if num_saves < 5: # that restriction is to keep the load menu fitting on the screen # items.append(MenuItem('New Game', self.on_new_game)) # new game is more important at the moment (and load game no work) items.append(MenuItem('New Game', self.on_new_game)) if num_saves: items.append(MenuItem('Continue Game - %s' % saves[-1][1], self.on_continue_game)) # items.append(MenuItem('Load Game', self.on_load_game)) items.append(MenuItem('Options', self.on_options)) items.append(MenuItem('Quit', self.on_quit)) self.create_menu(items, zoom_in(), zoom_out())
def __init__(self, cls_list, callback, **kwargs): super().__init__(title='CHOOSE PROMOTE') l = [] for cls in cls_list: l.append(MenuItem(cls, self.promote, cls)) self.create_menu(l, zoom_in(), zoom_out()) self.callback = callback self.kwargs = kwargs
def __init__(self, items, flag): super().__init__(title='Items') l = [] for item in items: content = item.itemtype.name + ' ' + str(item.use) + '/' + str(item.itemtype.max_use) l.append(MenuItem(content, self.call_banish, item)) self.create_menu(l, zoom_in(), zoom_out()) self.flag = flag
def __init__(self, item, flag): super().__init__(title='Handle') l = [] l.append(MenuItem('Banish', self.banish, item)) if flag: l.append(MenuItem('Transport', self.transport, item)) l.append(MenuItem('Cancel', self.cancel)) self.create_menu(l, zoom_in(), zoom_out())
def __init__(self, arena): super(Ordermenu, self).__init__(title='Order') self.arena = arena map = arena.map #type:map_controller.Main pid = arena.selected position = arena.target l = [] l.append(MenuItem('Move', self.move)) atk = map.find_attackable(pid, position) if len(atk) > 0: l.append(MenuItem('Attack', self.attack)) if len(map.global_vars.personBank[pid].item) > 0: l.append(MenuItem('Item', self.item)) self.avl = map.available_wand(pid) if len(self.avl) > 0: l.append(MenuItem('Wand', self.wand)) self.sup_dict = map.can_support(pid, position) if len(self.sup_dict) > 0: l.append(MenuItem('Support', self.support)) self.exc = map.have_exchange_object(pid, position) if len(self.exc) > 0: l.append(MenuItem('Exchange', self.exchange)) self.stl = map.can_steal(pid, position) if len(self.stl) > 0: l.append(MenuItem('Steal', self.steal, self.stl)) doors, key = map.unlock_door(position, pid) if len(doors) > 0: l.append(MenuItem('Doors', self.doors, doors, key)) talk_dict = map.find_talk_obj(pid, position) if len(talk_dict) > 0: l.append(MenuItem('Talk', self.talk, talk_dict)) event = map.get_grid_event(position, pid) _type = event[0] if (_type is 'V') and (not event[1] is None): l.append(MenuItem('Visit', self.visitvillage, event[1])) elif _type is 'T' and (not event[1] is None): _event, _item = event[1], event[2] if _event is not None: l.append(MenuItem('Treasury', self.treasury, _event, _item)) seize = map.get_seize_event(pid, position) if seize is not None: l.append(MenuItem('Seize', self.seize, seize)) self.allow_cancel = arena.allow_cancel if self.allow_cancel: l.append(MenuItem('Cancel', self.cancel)) self.create_menu(l, zoom_in(), zoom_out())
def __init__(self, avl, arena): super().__init__(title='Wands') l = [] for item in avl: content = item.itemtype.name + ' ' + str(item.use) + '/' + str( item.itemtype.max_use) l.append(MenuItem(content, self.wanduse, item)) l.append(MenuItem('Cancel', self.cancel)) self.create_menu(l, zoom_in(), zoom_out()) self.arena = arena
def __init__(self, items, arena): super(Showweapon, self).__init__(title='Weapons') l = [] for item in items: content = item.itemtype.name + ' ' + str(item.use) + '/' + str( item.itemtype.max_use) l.append(MenuItem(content, self.itemuse, item)) l.append(MenuItem('Cancel', self.cancel)) self.create_menu(l, zoom_in(), zoom_out()) self.arena = arena
def __init__(self, map, layer): super().__init__() self.map = map l = [] l.append(MenuItem('New_game', self.new_game)) l.append(MenuItem('Load_game', self._load_game, layer)) l.append(MenuItem('Quit', self.quit)) self.create_menu(l, zoom_in(), zoom_out())
def __init__(self, arena): super().__init__(title='Settings') l = [] l.append(MenuItem('Rolling', self.rolling)) l.append(MenuItem('Moving', self.moving)) l.append(MenuItem('Simplified', self.simple)) l.append(MenuItem('Autoend', self.auto_end)) l.append(MenuItem('Cancel', self.cancel)) self.arena = arena self.create_menu(l, zoom_in(), zoom_out())
def __init__(self, arena): super().__init__(title='Endturn') l = [] l.append(MenuItem('Endturn', self.end_turn)) l.append(MenuItem('Flags', self.flag)) l.append(MenuItem('Save', self.save)) l.append(MenuItem('Load', self.load)) l.append(MenuItem('Cancel', self.cancel)) l.append(MenuItem('Quit', self.quit)) l.append(MenuItem('Jump', self.jump)) self.create_menu(l, zoom_in(), zoom_out()) self.arena = arena
def __init__(self, arena, steallist, callback, **kwargs): super().__init__(title='CHOOSE STEAL') l = [] for item in steallist: content = item.itemtype.name + ' ' + str(item.use) + '/' + str( item.itemtype.max_use) l.append(MenuItem(content, self.steal, item)) l.append(MenuItem('Cancel', self.cancel)) self.create_menu(l, zoom_in(), zoom_out()) self.callback = callback self.kwargs = kwargs self.arena = arena
def __init__(self, items, map, arena): super(Weaponmenu, self).__init__(title='Weapons') w, h = director.get_window_size() self.w, self.h = w, h l = [] for item in items: if map.can_equip(arena.selected, item): l.append(MenuItem(item.itemtype.name, self.iteminfo, item)) l.append(MenuItem('Cancel', self.cancel)) self.create_menu(l, zoom_in(), zoom_out()) self.info = None self.arena = arena
def __init__(self): super(MainMenu, self).__init__() items = [] self.title = "" items.append(MenuItem('Play', self.on_new_game)) # items.append(MenuItem('Scores', self.on_score)) items.append(MenuItem('Story', self.on_story)) items.append(MenuItem('Credits', self.on_credits)) # items.append(MenuItem('Editor', self.on_editor,delay = 1.2)) # items.append(MenuItem('Options', self.on_configure)) items.append(MenuItem('Quit', self.on_quit)) self.create_menu(items, zoom_in(1.4), zoom_out(), shake())
def __init__(self): super(MainMenu, self).__init__() items = [] self.title="" items.append(MenuItem('Play', self.on_new_game)) # items.append(MenuItem('Scores', self.on_score)) items.append(MenuItem('Story', self.on_story)) items.append(MenuItem('Credits', self.on_credits)) # items.append(MenuItem('Editor', self.on_editor,delay = 1.2)) # items.append(MenuItem('Options', self.on_configure)) items.append(MenuItem('Quit', self.on_quit)) self.create_menu(items, zoom_in(1.4), zoom_out(), shake())
def __init__(self): super(MainMenu, self).__init__('') self.font_item['font_name'] = 'Edit Undo Line BRK', self.font_item['font_size'] = 45 item1 = MenuItem('Новая игра ', self.new_game) item2 = MenuItem('Загрузить сохраненнную игру', self.saved_game) item3 = MenuItem('Правила игры', self.rules) item4 = MenuItem('Информация', self.info) self.create_menu([item1, item2, item3, item4], zoom_in(), zoom_out(), layout_strategy=fixedPositionMenuLayout( [(650, 450), (650, 350), (650, 250), (650, 150)]))
def __init__(self): super(ConfigMenuMenu, self).__init__('') self.font_title['font_size'] = 20 self.font_item_selected['font_size'] = 20 self.font_item['font_size'] = 20 l = [] volumes = ['Mute', '10','20', '30', '40', '50', '60', '70', '80', '90', 'Max'] l.append( MultipleMenuItem('Music Volume: ', self.on_music_volume, volumes, 7)) l.append( MultipleMenuItem('SFX Volume: ', self.on_sfx_volume, volumes, 7)) l.append( MenuItem('Fullscreen', self.on_fullscreen)) l.append( MenuItem('Back', self.on_quit)) self.create_menu(l, zoom_in(1.4), zoom_out(), shake())
def __init__(self, items, arena, type): super().__init__(title='Wands') l = [] for item in items: content = item.itemtype.name + ' ' + str(item.use) + '/' + str( item.itemtype.max_use) if type is 2: l.append(MenuItem(content, self.wandrpr, item)) elif type is 3: l.append(MenuItem(content, self.wandstl, item)) l.append(MenuItem('Cancel', self.cancel)) self.create_menu(l, zoom_in(), zoom_out()) self.arena = arena self.type = type
def __init__(self): super(OptionMenu, self).__init__("Moon Game Options") self.menu_valign = CENTER self.menu_halign = CENTER self.font_title['font_size'] = 42 self.font_item['font_size'] = 20 self.font_item_selected['font_size'] = 20 items = [] items.append(MenuItem('Fullscreen', self.on_fullscreen)) items.append(MenuItem('OK', self.on_quit)) self.create_menu(items, zoom_in(), zoom_out())
def __init__(self): super().__init__() l = [] l.append( MenuItem('Continue', self.on_continue) ) # l.append( # MenuItem('Quit', self.on_quit) # ) self.create_menu( l, zoom_in(), zoom_out() )
def __init__(self, arena): super().__init__(title='Endturn') l = [] l.append(MenuItem('Endturn', self.end_turn)) l.append(MenuItem('Flags', self.flag)) l.append(MenuItem('Save', self.save)) l.append(MenuItem('Load', self.load)) l.append(MenuItem('Cancel', self.cancel)) l.append(MenuItem('Quit', self.quit)) l.append(MenuItem('Jump', self.jump)) l.append(MenuItem('Settings', self.setting)) l.append(MenuItem('ShowAttackRange', self.showattrng)) l.append(MenuItem('ShowThumb', self.showthumb)) l.append(MenuItem('Status', self.status)) self.create_menu(l, zoom_in(), zoom_out()) self.arena = arena
def __init__(self, item, menu, arena): super().__init__(title='Weapons') l = [] pid = arena.selected map = arena.map if map.can_use(pid, item): l.append(MenuItem('Use', self.use)) if map.can_equip(pid, item): l.append(MenuItem('Equip', self.equip)) if map.can_banish(pid, item): l.append(MenuItem('Banish', self.banish)) l.append(MenuItem('Cancel', self.cancel)) self.create_menu(l, zoom_in(), zoom_out()) self.item = item self.menu = menu self.arena = arena
def __init__(self, start): super(GameMenu, self).__init__("Veronica Defender") self.start = start self.menu_valign = CENTER self.menu_halign = CENTER # self.font_title['font_size'] = 32 items = [] items.append(MenuItem('Nuevo Juego', self.on_new_game)) items.append(MenuItem('Lalalala', self.on_new_game)) items.append(MenuItem('Salir', self.on_quit)) self.create_menu(items, zoom_in(), zoom_out())
def __init__(self): super().__init__() l = [] l.append( MenuItem('New Game', self.on_new_game) ) l.append( MenuItem('Options', self.on_options) ) l.append( MenuItem('Quit', self.on_quit) ) self.create_menu( l, ac.ScaleTo(1.2, duration=0.2), zoom_out() )
def __init__(self): super(MainMenu, self).__init__("Tank") pyglet.font.add_directory('./assets') self.font_title['font_name'] = 'You Are Loved' self.font_title['font_size'] = 62 self.font_item['font_name'] = 'You Are Loved' self.font_item_selected['font_name'] = 'You Are Loved' self.menu_valign = CENTER self.menu_halign = CENTER items = [] #items.append(MenuItem('Generate new background', self.generate_new_background)) items.append(MenuItem('Map Options', self.on_options)) #items.append(MenuItem('Scores', self.on_scores)) items.append(MenuItem('Quit', self.on_quit)) self.create_menu(items, zoom_in(), zoom_out())
def __init__(self): super(ConfigMenuMenu, self).__init__('') self.font_title['font_size'] = 20 self.font_item_selected['font_size'] = 20 self.font_item['font_size'] = 20 l = [] volumes = [ 'Mute', '10', '20', '30', '40', '50', '60', '70', '80', '90', 'Max' ] l.append( MultipleMenuItem('Music Volume: ', self.on_music_volume, volumes, 7)) l.append( MultipleMenuItem('SFX Volume: ', self.on_sfx_volume, volumes, 7)) l.append(MenuItem('Fullscreen', self.on_fullscreen)) l.append(MenuItem('Back', self.on_quit)) self.create_menu(l, zoom_in(1.4), zoom_out(), shake())
def __init__(self, level): super(HudLayer, self).__init__() self.level = level # configure the menu: self.menu_halign = LEFT self.menu_valign = CENTER self.selected = None self.mouse_x, self.mouse_y = None, None items = [] towers = [CommonTower, HardTower] for tower in towers: item = ImageMenuItem(images_for_sprites[tower], getattr(self, 'on_tower_callback'), tower) items.append(item) self.create_menu(items, selected_effect=zoom_in(), unselected_effect=zoom_out())
def __init__(self): super(PreJogoMenu, self).__init__(" 'Lasciate ogni speranza, voi che entrate.' ") self.font_title['font_name'] = 'Blood Of Dracula' self.font_title['font_size'] = 30 self.font_title['color'] = (255, 0, 0, 255) self.font_item['font_name'] = 'Bloodsuckers' self.font_item_selected['font_name'] = 'Bloodsuckers' itens = [] pumpkin = ImageMenuItem("pumpkin.png", self.on_start, 1) skull = ImageMenuItem("skull.gif", self.on_start, 2) pumpkin.scale = 2.0 skull.scale = 2.0 pumpkin.position = (70, 0) skull.position = (-70, 32) itens.append(pumpkin) itens.append(skull) desistir = MenuItem("Desista!!!", self.on_return) desistir.position = (desistir.position[0], desistir.position[1] - 50) itens.append(desistir) self.create_menu(itens, zoom_in(), zoom_out())