def __init__(self, device, server, fullscreen, width, height):
#init pygame
pygame.init()
#load font
font = pygame.font.SysFont(FONT, FONTSIZE)
#setup the screen
#set the screen caption
pygame.display.set_caption("Blue Dot")
#create the screen
screenflags = 0
if fullscreen:
screenflags = pygame.FULLSCREEN
if width == None and height == None:
display_info = pygame.display.Info()
width = display_info.current_w
height = display_info.current_h
if width == None: width = DEFAULTSIZE[0]
if height == None: height = DEFAULTSIZE[1]
screen = pygame.display.set_mode((width, height), screenflags)
#has a server been specified? If so connected directly
if server:
button_screen = ButtonScreen(screen, font, device, server, width, height)
button_screen.run()
else:
#start the devices screen
devices_screen = DevicesScreen(screen, font, device, width, height)
devices_screen.run()
pygame.quit()
评论列表
文章目录