Commits

César Bustíos committed 792108d

New game settings title

Comments (0)

Files changed (1)

         # New board?
         if new_game:
             board = generate_board(False)
-            display_new_game_settings()
+            display_new_game_settings('mk.ttf')
             #~ new_game = False
 
         pygame.display.update()
     return box_rects
 
 
-def display_new_game_settings():
+def display_new_game_settings(font_style):
     """
-    For choosing icons theme
+    For choosing icons themes
     """
     # Temporal surface for transparency
     tmp_surface = pygame.Surface(SCREEN_RESOLUTION)
     img_path = join(IMAGES_PATH, 'new_game_bg.png')
     new_game_img = pygame.image.load(img_path).convert()
 
+    # Top left corner of background image
+    left = 0
+    top = (SCREEN_RESOLUTION[1] / 2) - (new_game_img.get_height() / 2)
+
     # Get the image rect and set position on the screen
     new_game_rect = new_game_img.get_rect()
-    new_game_rect.left = 0
-    new_game_rect.top = (SCREEN_RESOLUTION[1] / 2) - (new_game_img.get_height() / 2)
+    new_game_rect.left = left
+    new_game_rect.top = top
 
     SCREEN.blit(new_game_img, new_game_rect)
 
+    # Title font and position
+    font = pygame.font.Font(join(FONTS_PATH, font_style), 40)
+    font_surface = font.render('Choose Icon Set', True, WHITE)
+    font_rect = font_surface.get_rect()
+    center = (left + (SCREEN_RESOLUTION[0] / 2), top + 30)
+    font_rect.center = center
+
+    SCREEN.blit(font_surface, font_rect)
+
 
 def reveal_box(board, row, col, box_img):
     """