core.components.menu.item_menu module

class core.components.menu.item_menu.ItemMenu(screen, resolution, game, name='Item Menu')

Bases: core.components.menu.menu.Menu

A class to create item menu objects. The item menu allows you to view and use items in your inventory.

Parameters:
  • screen (pygame.display) – The pygame.display surface to draw the menu to.
  • resolution (Tuple) – A tuple of the display’s resolution in (x, y) format. TODO: We should be able to get this from pygame.display
  • game (core.control.Control) – The main tuxemon game object that contains all the game’s variables.

To create a new menu, simply create a new menu instance and then set the size and coordinates of the menu like this:

Example:

>>> item_menu = ItemMenu(screen, resolution, self)
>>> item_menu.size_x = 200
>>> item_menu.size_y = 100
>>> item_menu.pos_x = 500
>>> item_menu.pos_y = 500
>>> item_menu.draw()
draw(draw_borders=True, fill_background=False)
get_event(event, game)