def render(self, display): pygame.draw.polygon(display, (239, 226, 235), poly_1) pygame.draw.polygon(display, (206, 51, 65), poly_2) pygame.draw.polygon(display, (241, 65, 78), poly_3) pygame.draw.polygon(display, (206, 51, 65), poly_4) pygame.draw.polygon(display, (239, 226, 235), poly_5) # pygame.draw.polygon(display, (40, 35, 32), poly_6) # pygame.draw.polygon(display, (50, 50, 50), poly_7) # pygame.draw.polygon(display, (40, 35, 32), poly_8) utils.draw_button_info(display, **self.keys) # info = game.FONT_16.render("todo: information here and back to line", True, (255, 255, 255)) # display.blit(info, (int(SURFACE_SIZE[0] * 0.25), int(SURFACE_SIZE[1] * 0.85))) for i in range(len(centre_circle)): c = centre_circle[i] if self.selected == i: pygame.draw.circle(display, (0, 0, 0), c, 40) display.blit(self.arrow, (c[0] - 51, c[1] - 13)) else: pygame.draw.circle(display, (255, 255, 255), c, 40) display.blit(self.image[i], (c[0] - 32, c[1] - 32)) t_i = game.FONT_16.render(self.text[i], True, (255, 255, 255)) x_min = (len(self.text[i]) / 2) * game.FONT_SIZE_16[0] display.blit(t_i, (c[0] - x_min, c[1] + 45))
def render(self, display): display.fill((255, 255, 255)) pygame.draw.polygon(display, (241, 65, 78), TeamMenu.t_poly_1) pygame.draw.polygon(display, (206, 51, 65), TeamMenu.t_poly_2) pygame.draw.rect(display, (0, 0, 0), (0, 570, 1060, 30)) display.blit(self.cat_image, (10, 10)) display.blit(game.FONT_BOLD_58.render( game.get_game_instance().get_message("team").upper(), True, (0, 0, 0)), (74, 10)) g_x = SURFACE_SIZE[0] * 0.1 g_y = 70 _time = utils.current_milli_time() - self.open_time part_time = _time % 2000 poke_y = 0 if part_time < 900: poke_y = 0 elif part_time < 950 or 1950 <= part_time: poke_y = 1 elif part_time < 1000 or 1900 <= part_time: poke_y = 3 elif part_time < 1900: poke_y = 5 for i in range(self.player.get_non_null_team_number()): if self.move != i: color = (0, 0, 0) if self.selected == i else (255, 255, 255) text_color = (0, 0, 0) if self.selected != i else (255, 255, 255) utils.draw_pokemon(display, self.player.team[i], (int(g_x), int(g_y)), poke_y, color=color, text_color=text_color) g_y += 80 # draw move if self.move != -1: color = (0, 0, 0) if self.selected == self.move else (255, 255, 255) text_color = (0, 0, 0) if self.selected != self.move else (255, 255, 255) utils.draw_pokemon(display, self.player.team[self.move], (int(g_x + SURFACE_SIZE[0] * 0.04), int(self.selected * SURFACE_SIZE[1] * 0.15 + SURFACE_SIZE[1] * 0.05)), poke_y, color=color, text_color=text_color) select = self.player.team[self.selected] if select: display.blit(select.get_front_image(4), (SURFACE_SIZE[0] * 0.5, SURFACE_SIZE[1] * 0.2)) # action hud if self.action_selected != -1: _y = (-35 if self.selected == 5 else 40) + SURFACE_SIZE[1] * 0.15 * self.selected _x = SURFACE_SIZE[0] * 0.31 if self.action_type == 0: utils.draw_select_box(display, _x, _y, self.text_2, self.action_selected, 100) else: utils.draw_select_box(display, _x, _y, self.box_object, self.action_selected, 100) utils.draw_button_info(display, **self.keys)
def render(self, display: pygame.Surface): display.fill("#e8f2fe") pygame.draw.polygon(display, "#b4ea34", PCHud.POLY_1) pygame.draw.polygon(display, "#9bd600", PCHud.POLY_2) utils.draw_button_info(display, **self.keys) self.draw_team(display) self.draw_box(display) self.draw_info(display)
def render(self, display: pygame.Surface): display.fill("#ecdcdf") pygame.draw.polygon(display, "#e7a300", Bag.poly_1) pygame.draw.polygon(display, "#f2b71f", Bag.poly_2) display.blit(self.cat_image, (10, 10)) display.blit(game.FONT_BOLD_58.render(game.get_game_instance().get_message("bag").upper(), True, (0, 0, 0)), (74, 10)) self.draw_team(display) self.draw_items(display) utils.draw_button_info(display, **self.keys)
def render(self, display: pygame.Surface): # background ========== display.fill('#e6ffff') pygame.draw.polygon(display, "#c42833", ((424, 0), (530, 0), (212, 600), (106, 600))) pygame.draw.polygon(display, "#e3313f", ((0, 0), (424, 0), (106, 600), (0, 600))) pygame.draw.polygon(display, (0, 0, 0), ((585, 30), (1060, 30), (1060, 60), (570, 60))) # ==================== utils.draw_button_info(display, **self.__keys) self.draw_name_and_stats(display) self.draw_ability(display)
def render(self, display): display.fill((255, 255, 255)) pygame.draw.polygon(display, (241, 65, 78), TeamMenu.t_poly_1) pygame.draw.polygon(display, (206, 51, 65), TeamMenu.t_poly_2) pygame.draw.rect(display, (0, 0, 0), (0, 570, 1060, 30)) g_x = SURFACE_SIZE[0] * 0.1 g_y = SURFACE_SIZE[1] * 0.1 _time = utils.current_milli_time() - self.open_time part_time = _time % 2000 poke_y = 0 if part_time < 900: poke_y = 0 elif part_time < 950 or 1950 <= part_time: poke_y = 1 elif part_time < 1000 or 1900 <= part_time: poke_y = 3 elif part_time < 1900: poke_y = 5 for i in range(len(self.progress)): if self.move != i: self.draw_pokemon(display, i, g_x, g_y, poke_y) g_y += SURFACE_SIZE[1] * 0.15 # draw move if self.move != -1: self.draw_pokemon( display, self.move, g_x + SURFACE_SIZE[0] * 0.04, self.selected * SURFACE_SIZE[1] * 0.15 + SURFACE_SIZE[1] * 0.05, poke_y) # action hud if self.action_selected != -1: _y = SURFACE_SIZE[1] * 0.13 + SURFACE_SIZE[1] * 0.15 * self.selected _x = SURFACE_SIZE[0] * 0.31 utils.draw_select_box(display, _x, _y, self.text_2, self.action_selected, 100) utils.draw_button_info(display, **self.keys)
def render(self, display: pygame.Surface) -> NoReturn: display.fill("#ecdcdf") pygame.draw.polygon(display, "#f4523b", PokeDex.poly_1) pygame.draw.polygon(display, "#fa7248", PokeDex.poly_2) pygame.draw.polygon(display, "#333333", PokeDex.poly_3) pygame.draw.polygon(display, "#cedae0", PokeDex.poly_4) utils.draw_button_info(display, **self.keys) nb = game.FONT_24.render(game.get_game_instance().get_message("number"), True, (255, 255, 255)) nb_s = nb.get_size() # 839 = (1060 - x(40)) // 2 + x(40) display.blit(nb, (839 - (nb_s[0] // 2), 40 - (nb_s[1] // 2))) nb = game.FONT_24.render(game.get_game_instance().get_message("pokedex"), True, (0, 0, 0)) display.blit(nb, (10, 40 - (nb_s[1] // 2))) x_1 = 20 + nb.get_size()[0] pygame.draw.rect(display, "#595959", (x_1, 22, 100, 34), border_radius=10) display.blit(f := game.FONT_20.render(str(self.nb_caught), True, (255, 255, 255)), (x_1 + 50, 40 - (f.get_size()[1] // 2))) display.blit(utils.RED_POKEBALL, (x_1 + 10, 23)) pygame.draw.rect(display, "#595959", (x_1 + 110, 22, 100, 34), border_radius=10) display.blit(f := game.FONT_20.render(str(self.nb_saw), True, (255, 255, 255)), (x_1 + 160, 40 - (f.get_size()[1] // 2))) display.blit(utils.POINT_POKEBALL, (x_1 + 120, 23)) range_ = self.get_range() y = 90 for id_ in range(*range_): self.draw_pokemon(display, id_, y) if self.selected == id_: display.blit(self.arrow, (625, y + 10)) y += 50
def render(self, display: pygame.Surface): display.fill("#ecdcdf") pygame.draw.polygon(display, "#f4523b", PokeDexInfo.poly_1) pygame.draw.polygon(display, "#fa7248", PokeDexInfo.poly_2) pygame.draw.polygon(display, "#f4523b", PokeDexInfo.poly_3) utils.draw_button_info(display, **self.keys) poke = pokemon.get_pokemon(self.selected + 1) # big big_im = displayer.get_poke(PokeDex.PATH(str(poke.id_)), 3) s_x, s_y = big_im.get_size() display.blit(big_im, (250 - s_x // 2, 300 - s_y // 2)) utils.draw_split_rectangle(display, (477, 60, 530, 50), 0.4, 0.35, "#f0501e", "#000000") utils.draw_arrow(display, True, 742, 56, (255, 255, 255), size=2) utils.draw_arrow(display, False, 742, 114, (255, 255, 255), size=2) y = 62 im = displayer.get_poke(PokeDex.PATH(str(poke.id_)), 0.7) delta_x, delta_y = utils.get_first_color(im) x = 480 display.blit(im, (x, y + 30 - delta_y)) status = game.get_game_instance().get_pokedex_status(self.selected + 1) display.blit(game.FONT_24.render(f"N° {pokemon.to_3_digit(self.selected + 1)}", True, (255, 255, 255)), (x + 50, y + 10)) display.blit(game.FONT_24.render(poke.get_name(True) if poke.id_ != 0 else "???", True, (255, 255, 255)), (689, y + 10)) if status != game.POKEDEX_NEVER_SEEN: display.blit( self.white_pokeball if status == game.POKEDEX_CATCH else utils.POINT_POKEBALL, (950, y + 8) ) x, y = 530, 150 l = 424 h = 40 s = 3 pygame.draw.rect(display, "#dbdbd9", (x, y, l, h,)) display.blit(tx := game.FONT_24.render(poke.get_japan_name(), True, (0, 0, 0)), (x + (l - tx.get_size()[0]) // 2, y + (h - tx.get_size()[1]) // 2)) y += h + s tx = ("type", "size", "weight", "view") tx2 = (None, f'{poke.size} m', f'{poke.weight} Kg', str(game.get_game_instance().get_nb_view(self.selected + 1))) for i in range(4): pygame.draw.rect(display, "#dbdbd9", (x, y, l // 2, h)) pygame.draw.rect(display, "#ffffff", (x + l // 2, y, l // 2, h)) display.blit(sur := game.FONT_24.render(game.get_game_instance().get_message(tx[i]), True, (0, 0, 0)), utils.get_center(sur, (x, y, l // 2, h))) if i != 0: display.blit(sur := game.FONT_24.render(tx2[i], True, (0, 0, 0)), utils.get_center(sur, (x + l // 2 + 5, y, l // 2, h), center_x=False)) else: _x_ = x + l // 2 + 10 for ii in range(len(poke.types)): utils.draw_type(display, _x_, y + h // 2 - 8, poke.types[ii]) _x_ += 106 y += h if i != 3: pygame.draw.rect(display, "#d2d2d2", (x, y, l // 2, s)) pygame.draw.rect(display, "#f3f3f3", (x + l // 2, y, l // 2, h)) y += s pygame.draw.rect(display, "#ffffff", (x, y, l, int(h * 4.5))) x += 5 y += 10 for p_l in hud.Dialog.split(poke.get_pokedex(), 40): display.blit(game.FONT_20.render(p_l, True, (0, 0, 0)), (x, y)) y += game.FONT_SIZE_20[1] + 5