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()
评论列表
文章目录