How I can fix pygame background not working?

Azka Hamidzan F.

I want to add background to my app in python pygame but its not working help? heres the code

import pygame
import sys
import os

# initial pygame
pygame.init()

# frame :
screen = pygame.display.set_mode((800, 600))

# Background 
background = pygame.image.load('background.png')

# the title
pygame.display.set_caption("Untitled")

# Loop
running = True
while True:
    screen.blit(background, (0, 0))
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            exit()

also i haven't finish the whole app yet

Rabbid76

You must update the display:

running = True
while True:
    screen.blit(background, (0, 0))
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            exit()

    pygame.display.update()

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How i can fix the Background on Mobile?

how can i fix this background bug?

How can I fix the slowness of my pygame event loop?

How can I fix my sprite animation in pygame?

how can i fix attribute error in python pygame?

How can I fix this not working redirection to a not working URL containing an ' character?

How can I fix my desktop background setting?

fetch and axios are not working inside PlaidLink component, how can I fix this?

My sound stopped working today, how can I fix it?

Text shining effect not working properly how can I fix this

Java returning empty array not working, how can i fix?

Render function partly working, how can i fix this?

How can I fix Sass Calc for width not working

how can i fix my javascript calculation which is not working?

Breadcrumb react code not working, how can i fix it?

ionic serve not working properly How can I fix the error?

How can I fix .exe stopped working error?

Why is JavaCC not working on my mac and how can I fix it?

How can I fix my dotfiles that prevent pulseaudio from working?

My var_dump stop working, how can i fix it?

Discord bot only working in pm, how can i fix this?

How can I fix new comment list not working in DOM Javascript?

How can i fix it? sticky navbar working only in first div

C# color code not working properly how can I fix this?

How can I fix my Binary Search code not working as expected?

How can I fix member count not working in discord.py?

How can I fix this problem that I am having with screen.blit in pygame in python?

How to fix CSS background image not working?

How can i fix this?