#๐Ÿ”’ I need help on how to fit the size of image i imported in pygame.

6 messages ยท Page 1 of 1 (latest)

wary magnet
#
from sys import exit

pygame.init
screen = pygame.display.set_mode((800,400))
pygame.display.set_caption("random")

clock = pygame.time.Clock()

test_surface = pygame.image.load('images.jpg')



while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            exit()
    
    screen.blit(test_surface,(0,0))
    pygame.display.update()
    clock.tick(60)```

I just started doing pygame.

Output:
crude thunderBOT
#

Hey @wary magnet!

Please edit your message to use a code block

Add a py after the three backticks.

```py
print('Hello, world!')
```

This will result in the following:

print('Hello, world!')```
crude thunderBOT
#

@wary magnet

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.

wary magnet
#

!close

crude thunderBOT
#
Python help channel closed with !close

This help channel has been closed. 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.