#๐Ÿ”’ Pygame Bottom of Screen Artifact

8 messages ยท Page 1 of 1 (latest)

copper grailBOT
#

@winged viper

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

winged viper
#

I have a radial gradient image that follows the mouse in a sort of "flashlight" effect within my game, but whenever the image gets near the bottom of the screen, artifacts begin appearing during movement.
The smallest amount of code that shows the artifact on my computer is below:

import pygame, time

pygame.init()
screen = pygame.display.set_mode((1280, 720))
clock = pygame.time.Clock()
running = True

flashlight_img = pygame.image.load("Assets/Images/GUI/Flashlight.png").convert_alpha()

def draw_screen():
    screen.fill("black")
    
    mpos = pygame.mouse.get_pos()
    
    if pygame.mouse.get_pressed()[2]:
        screen.blit(flashlight_img, (mpos[0]-192, mpos[1]-192))
    
    pygame.display.flip()

while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
    
    draw_screen()

    clock.tick(60)

pygame.quit()

I have tried multiple solutions found online, but none of them have seemed to work, such as enabling doublebuffer, or having an intermediatory surface
I will attempt to attach a video displaying the artifact.

#

The video does not work, but here is an image

#

Similar artifacts appear even during slow movement

#

!close

copper grailBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.