UiConfig

class pygamelib.gfx.ui.UiConfig(game=None, box_vertical_border='│', box_horizontal_border='─', box_top_left_corner='╭', box_top_right_corner='╮', box_bottom_left_corner='╰', box_bottom_right_corner='╯', box_vertical_and_right='├', box_vertical_and_left='┤', fg_color=Color(255, 255, 255), bg_color=Color(0, 128, 128), fg_color_inactive=Color(128, 128, 128), bg_color_selected=Color(128, 128, 128), bg_color_not_selected=None, fg_color_selected=Color(0, 255, 0), fg_color_not_selected=Color(255, 255, 255), bg_color_menu_not_selected=Color(128, 128, 128), border_fg_color=Color(255, 255, 255), border_bg_color=None, borderless_dialog=True)

A configuration object for the UI module. TEST

This object’s purpose is to configure the look and feel of the UI widgets. It does nothing by itself.

Parameters:
  • game (Game) – The game object.
  • box_vertical_border (str) – The vertical border of a box.
  • box_horizontal_border (str) – The horizontal border of a box.
  • box_top_left_corner (str) – The top left corner of a box.
  • box_top_right_corner (str) – The top right corner of a box.
  • box_bottom_left_corner (str) – The bottom left corner of a box.
  • box_bottom_right_corner (str) – The bottom right corner of a box.
  • box_vertical_and_right (str) – The left junction between two boxes.
  • box_vertical_and_left (str) – The right junction between two boxes.
  • fg_color (Color) – The foreground color (for text and content).
  • bg_color (Color) – The background color (for text and content).
  • fg_color_inactive (Color) – The foreground color for inactive items like menu entries.
  • bg_color_selected (Color) – The background color (for selected text and content).
  • bg_color_not_selected (Color) – The background color (for non selected text and content).
  • fg_color_selected (Color) – The foreground color (for selected text and content).
  • fg_color_not_selected (Color) – The foreground color (for non selected text and content).
  • bg_color_menu_not_selected (Color) – The menu background color (for expanded menu items).
  • border_fg_color (Color) – The foreground color (for borders).
  • border_bg_color (Color) – The background color (for borders).
  • borderless_dialog (bool) – Is the dialog borderless or not.

Example:

config_ui_red = UiConfig(
    fg_color=Color(255,0,0),
    border_fg_color=Color(255,0,0)
)
__init__(game=None, box_vertical_border='│', box_horizontal_border='─', box_top_left_corner='╭', box_top_right_corner='╮', box_bottom_left_corner='╰', box_bottom_right_corner='╯', box_vertical_and_right='├', box_vertical_and_left='┤', fg_color=Color(255, 255, 255), bg_color=Color(0, 128, 128), fg_color_inactive=Color(128, 128, 128), bg_color_selected=Color(128, 128, 128), bg_color_not_selected=None, fg_color_selected=Color(0, 255, 0), fg_color_not_selected=Color(255, 255, 255), bg_color_menu_not_selected=Color(128, 128, 128), border_fg_color=Color(255, 255, 255), border_bg_color=None, borderless_dialog=True)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__([game, box_vertical_border, …]) Initialize self.
instance(*args, **kwargs) Returns the instance of the UiConfig object