def __init__(self, drivers=DEFAULT_DRIVERS, size=DEFAULT_SIZE, screen_type=DEFAULT_SCREEN, borders=(5, 5),
border_width=3, line_color=(255, 255, 255), font='freesans', font_color=(255, 255, 255),
icons=ICON_DICTIONARY):
"""DisplayDriver class is the class that build the base display for use in the weather
app. Argument descriptions: drivers is a tuple of strings with available SDL_VIDEODRIVER
environmental varaibles; size is a tuple of two integers describing the x, y size of the
screen; screen_type is a string value that corresponds to the pygame constants for
dispay.set_mode
"""
formats = {'no_frame': pygame.NOFRAME, 'full_screen': pygame.FULLSCREEN, 'double_buff': pygame.DOUBLEBUF,
'hw_surface': pygame.HWSURFACE, 'open_GL': pygame.OPENGL, 'resizable': pygame.RESIZABLE}
self._system_data = SystemData()
self._display_instance = None
self._drivers = drivers
self._size = size
self._borders = borders
self._border_width = border_width
self._line_color = line_color
self._font = font
self._font_color = font_color
self._format = formats[screen_type]
self._icons = icons
self._base_dir = os.getcwd() + ICON_BASE_DIR
self._scale_icons = True
self._xmax = self._size[0] - self._borders[0]
self._ymax = self._size[1] - self._borders[1]
self._av = 1
self._av_time = 1
self._screen = None
self._blits = []
评论列表
文章目录