ui.py 文件源码

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

项目:mqtt-control-panel 作者: colinodell 项目源码 文件源码
def __init__(self, background = None):
        # Init framebuffer/touchscreen environment variables
        os.putenv('SDL_VIDEODRIVER', 'fbcon')
        os.putenv('SDL_FBDEV', '/dev/fb1')
        os.putenv('SDL_MOUSEDRV', 'TSLIB')
        os.putenv('SDL_MOUSEDEV', '/dev/input/touchscreen')

        self._backlight_on = True
        self.on()

        # Init pygame and screen
        print "Initting..."
        pygame.init()
        print "Setting Mouse invisible..."
        pygame.mouse.set_visible(False)
        print "Setting fullscreen..."
        modes = pygame.display.list_modes(16)
        self._screen = pygame.display.set_mode(modes[0], pygame.FULLSCREEN, 16)
        self._needs_update = True

        # Load background
        self._background = pygame.image.load(background)
        self._screen.fill(0)
        self._screen.blit(self._background, (0, 0))
        pygame.display.update()

        # Load font
        self._font = pygame.font.SysFont("Arial", 24)

        self._images = []
        self._buttons = []
        self._status_lines = []

        self.update()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号