app.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:BlueDot 作者: martinohanlon 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号