core.components.menu.interface module

class core.components.menu.interface.HpBar(value=1.0)[source]

Bases: object

HP bar for UI elements.

border = None
border_filename = 'gfx/ui/monster/hp_bar.png'
static calc_inner_rect(rect)[source]
Calculate the inner rect to draw fg_color that fills bar
The values here are calculated based on game scale and the content of the border image file.
Parameters:rect
Returns:
draw(surface, rect)[source]
load_graphics()[source]

Image become class attribute, so is shared. Eventually, implement some game-wide image caching

class core.components.menu.interface.MenuCursor(image)[source]

Bases: pygame.sprite.Sprite

class core.components.menu.interface.MenuItem(image, label, description, game_object)[source]

Bases: pygame.sprite.Sprite

in_focus
toggle_focus()[source]