Pergunta

Quick question on the raspberry pi. I am new to it but know java and some basic python. My question is this, if i need a black background (except for some lit up colored boxes), how can this be achieved? More specifically, what gui would you recommend and how would I set up the frame? Thanks for any help!

Foi útil?

Solução

The question seems kind of unclear, but I'll take a shot.


Use PyGame to create a black background in a window.

Here is the PyGame code needed for this:

import pygame, sys
from pygame.locals import *

pygame.init()

BLACK = (0, 0, 0)

WIDTH = 1280
HEIGHT = 1024
windowSurface = pygame.display.set_mode((WIDTH, HEIGHT), 0, 32)

while True:
    windowSurface.fill(BLACK)
    pygame.display.flip()

On my computer: On my computer:

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top