def __button_small(b_coord_x: int, b_coord_y: int, b_caption: str, b_filled: bool = False): if b_filled: draw.rectangle_solid(rect_coord_x=b_coord_x, rect_coord_y=b_coord_y, rect_width=settings.BUTTON_SMALL_WIDTH, rect_height=settings.BUTTON_SMALL_HEIGHT, rect_color=settings.BUTTON_FILLED_COLOR, rect_tilt=False) draw.rectangle_outline(rect_coord_x=b_coord_x, rect_coord_y=b_coord_y, rect_width=settings.BUTTON_SMALL_WIDTH, rect_height=settings.BUTTON_SMALL_HEIGHT, rect_border_color=settings.BUTTON_BORDER_COLOR, rect_border_width=settings.BUTTON_BORDER_LEN, rect_tilt=False) draw.character(char_string=b_caption, char_coord_x=b_coord_x, char_coord_y=b_coord_y, char_color=settings.BUTTON_CAPTION_COLOR, char_font_size=settings.BUTTON_CAPTION_FONT_SIZE, char_font_name=settings.BUTTON_CAPTION_FONT_NAME, char_rotation_angle=6 if b_filled else 0, char_font_bold=settings.BUTTON_CAPTION_STYLE_BOLD, char_font_italic=settings.BUTTON_CAPTION_STYLE_ITALIC, char_anchor=True)
def render_numeric_index(): for side in ('left', 'right'): number_coord_x = int(settings.BOARD_MARGIN_LEN / 2) number_coord_y = int(settings.BOARD_MARGIN_LEN + settings.TILE_SIDE_LEN / 2) number_rotation = 0 if side == 'right': number_coord_x = int(settings.BOARD_SIDE_LEN - settings.BOARD_MARGIN_OUTER_LEN / 2) number_coord_y = int(settings.BOARD_MARGIN_LEN + settings.TILE_SIDE_LEN / 2) number_rotation = 180 for number in settings.BOARD_NUMBER_INDEX: draw.character( char_string=number, char_coord_x=number_coord_x, char_coord_y=number_coord_y, char_color=settings.BOARD_MARGIN_COLOR_INNER, char_font_size=settings.BOARD_INDEX_FONT_SIZE, char_font_name=settings.BOARD_INDEX_FONT_NAME, char_rotation_angle=number_rotation, char_font_bold=settings.BOARD_INDEX_STYLE_BOLD, char_font_italic=settings.BOARD_INDEX_STYLE_ITALIC, char_anchor=True) number_coord_y += settings.TILE_SIDE_LEN
def render_letter_index(): for side in ('bottom', 'top'): letter_coord_x = int(settings.BOARD_MARGIN_LEN + settings.TILE_SIDE_LEN / 2) letter_coord_y = int(settings.BOARD_MARGIN_LEN / 2) letter_rotation = 0 if side == 'top': letter_coord_x = int(settings.BOARD_MARGIN_LEN + settings.TILE_SIDE_LEN / 2) letter_coord_y = int(settings.BOARD_SIDE_LEN - settings.BOARD_MARGIN_OUTER_LEN / 2) letter_rotation = 180 for letter in settings.BOARD_LETTER_INDEX: draw.character( char_string=letter, char_coord_x=letter_coord_x, char_coord_y=letter_coord_y, char_color=settings.BOARD_MARGIN_COLOR_INNER, char_font_size=settings.BOARD_INDEX_FONT_SIZE, char_font_name=settings.BOARD_INDEX_FONT_NAME, char_rotation_angle=letter_rotation, char_font_bold=settings.BOARD_INDEX_STYLE_BOLD, char_font_italic=settings.BOARD_INDEX_STYLE_ITALIC, char_anchor=True) letter_coord_x += settings.TILE_SIDE_LEN
def display(self): upper_coordinates, lower_coordinates = self.coordinates upper_coord_x, upper_coord_y = upper_coordinates lower_coord_x, lower_coord_y = lower_coordinates draw.character( char_string=self._upper_caption, char_coord_x=upper_coord_x, char_coord_y=upper_coord_y, char_color=settings.LOGO_CAPTION_COLOR, char_font_name=settings.LOGO_CAPTION_FONT_NAME, char_font_size=22, char_font_bold=settings.LOGO_CAPTION_STYLE_BOLD, char_font_italic=settings.LOGO_CAPTION_STYLE_ITALIC, char_rotation_angle=0, char_anchor=True ) draw.character( char_string=self._lower_caption.upper(), char_coord_x=lower_coord_x, char_coord_y=lower_coord_y, char_color=settings.LOGO_CAPTION_COLOR, char_font_name=settings.LOGO_CAPTION_FONT_NAME, char_font_size=28, char_font_bold=settings.LOGO_CAPTION_STYLE_BOLD, char_font_italic=settings.LOGO_CAPTION_STYLE_ITALIC, char_rotation_angle=0, char_anchor=True )
def display(self): coordinate_x, coordinate_y = self.coordinates draw.character( char_string=self.caption, char_coord_x=coordinate_x, char_coord_y=coordinate_y, char_color=settings.CLOCKFACE_CAPTION_COLOR, char_rotation_angle=0, char_font_name='tahoma', char_font_size=12, char_font_bold=False, char_font_italic=False, char_anchor=True )
def __checker_complex_queen_index(ch_coord_x: int, ch_coord_y: int, ch_color: str): draw.character( char_string='Q', char_coord_x=ch_coord_x, char_coord_y=ch_coord_y + 2, char_color=settings.CHECKER_COLOR_WHITE_ALT if ch_color.lower() == 'white' else settings.CHECKER_COLOR_BLACK_ALT if ch_color.lower() == 'black' else settings.ERROR_COLOR_ALT, char_font_size=round(settings.CHECKER_QUEEN_INDEX_FONT_SIZE * 2.2, 0), char_font_name=settings.CHECKER_QUEEN_INDEX_FONT_NAME, char_font_bold=False, char_font_italic=False, char_anchor=True, char_rotation_angle=0)
def display(self): if self.caption != 'NAME': coordinate_x, coordinate_y = self.coordinates draw.character( char_string=self.caption, char_coord_x=coordinate_x, char_coord_y=coordinate_y, char_color=settings.MENU_CAPTION_COLOR, char_font_name=settings.MENU_CAPTION_FONT_NAME, char_font_size=settings.MENU_CAPTION_FONT_SIZE, char_font_bold=settings.MENU_CAPTION_STYLE_BOLD, char_font_italic=settings.MENU_CAPTION_STYLE_ITALIC, char_rotation_angle=0, char_anchor=True )
def clockface(cf_coord_x: int, cf_coord_y: int, cf_value: list): value_list = cf_value if not isinstance(cf_value, list): value_list = [23, 59, 59] hours, minutes, seconds = value_list hours = f'{hours}' if hours >= 10 else f'0{hours}' minutes = f'{minutes}' if minutes >= 10 else f'0{minutes}' seconds = f'{seconds}' if seconds >= 10 else f'0{seconds}' cf_time_string = f'{hours}:{minutes}:{seconds}' draw.character(char_string=cf_time_string, char_coord_x=cf_coord_x, char_coord_y=cf_coord_y, char_color=settings.CLOCKFACE_CAPTION_COLOR, char_font_size=settings.CLOCKFACE_CAPTION_FONT_SIZE, char_font_name=settings.CLOCKFACE_CAPTION_FONT_NAME, char_font_bold=settings.CLOCKFACE_CAPTION_STYLE_BOLD, char_font_italic=settings.CLOCKFACE_CAPTION_STYLE_ITALIC, char_rotation_angle=0, char_anchor=True)