0

I made code to draw 2 lines, but, it only draws the first line to the window. However, everything else on the window works fine and it is always updating and responding.

Relevant Code:

WINDOW = pygame.display.set_mode((1000,800), pygame.FULLSCREEN)
while True:
    WINDOW.fill((0,0,0))
    pygame.draw.line(WINDOW, (255,255,255), (0,0),(0,799))
    pygame.draw.line(WINDOW, (255,255,255), (999,0),(999,799))
    pygame.display.update()
  • 3
    To be clear: the idea is to draw two white lines, *each 1 pixel wide, along the extreme edges* of a black screen? Did you consider that maybe they're there and you just can't see one of them - for example, because there's something off with your monitor calibration such that the entire grid of pixels isn't within the physically viewable area? Can you see two lines if you draw them with different coordinates? What about if you try windowed mode, or different resolution settings? What if you try recalibrating your monitor? – Karl Knechtel Mar 16 '23 at 01:05
  • You have to handle the events by either [`pygame.event.pump()`](https://www.pygame.org/docs/ref/event.html#pygame.event.pump) or [`pygame.event.get()`](https://www.pygame.org/docs/ref/event.html#pygame.event), to keep the window responding. – Rabbid76 Mar 16 '23 at 05:38

1 Answers1

1

I tried your program and it works as intended.you could try to draw the lines a bit closer to the center as a fast solution, and i think your monitor could be the problem.

Demian
  • 11
  • 2