Jump to content

How to setup background from Pygame?

ZaBoss
 Share

I have programming class (private and for Python) and I am making a game using Pygame. I know how to load an image but not a background, what is the code to load a background? (Using pygame)

RIG:  CPU: Intel Core i5-4690K CPU Cooler: Corsair H80i Motherboard: ASRock Fatal1ty Z97 Killer ATX Memory: G.Skill Ripjaws Series 8GB Storage: Seagate Barracuda 1TB Internal HDD SSD: Samsung 840 Series 120GB 2.5" SSD Video Card: Zotac GeForce GTX 970 4GB Video Card Case: Corsair 780T PSU: NZXT HALE82 850W 80+ Bronze Monitor: LG 34UM95-P Keyboard: Steelseries Apex Keyboard Mouse: Razer Taipan Mouse Mat: Razer Vespula Sound: Cyber Acoustics CA-3090, Corsair Vengeance 2100 :  1998.40 Euro

Link to comment
Share on other sites

Link to post
Share on other sites

An image is an image, you load it just like everything else.

So just : background = pygame.image.load(name of picture)

RIG:  CPU: Intel Core i5-4690K CPU Cooler: Corsair H80i Motherboard: ASRock Fatal1ty Z97 Killer ATX Memory: G.Skill Ripjaws Series 8GB Storage: Seagate Barracuda 1TB Internal HDD SSD: Samsung 840 Series 120GB 2.5" SSD Video Card: Zotac GeForce GTX 970 4GB Video Card Case: Corsair 780T PSU: NZXT HALE82 850W 80+ Bronze Monitor: LG 34UM95-P Keyboard: Steelseries Apex Keyboard Mouse: Razer Taipan Mouse Mat: Razer Vespula Sound: Cyber Acoustics CA-3090, Corsair Vengeance 2100 :  1998.40 Euro

Link to comment
Share on other sites

Link to post
Share on other sites

yup

Thanks.

RIG:  CPU: Intel Core i5-4690K CPU Cooler: Corsair H80i Motherboard: ASRock Fatal1ty Z97 Killer ATX Memory: G.Skill Ripjaws Series 8GB Storage: Seagate Barracuda 1TB Internal HDD SSD: Samsung 840 Series 120GB 2.5" SSD Video Card: Zotac GeForce GTX 970 4GB Video Card Case: Corsair 780T PSU: NZXT HALE82 850W 80+ Bronze Monitor: LG 34UM95-P Keyboard: Steelseries Apex Keyboard Mouse: Razer Taipan Mouse Mat: Razer Vespula Sound: Cyber Acoustics CA-3090, Corsair Vengeance 2100 :  1998.40 Euro

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×