Jump to content

Pygame Issue

Hi,

I have been troubleshooting this program (written in python) for a while. I expect the water texture to be in the top left corner of the window, but it's just a blank screen.

I'll include a link to the folder that the program is in rather than copying the code because there are a few other files in it.

https://drive.google.com/drive/folders/1q_j4fd51ZiLaU_hDeHbHWDIoxOUKrlWW?usp=sharing

Thanks for your help.

Link to comment
Share on other sites

Link to post
Share on other sites

You specified a height and width of 0 for your map surface.  
Give it the same height and width as your window (or whatever you want), and you should see the texture.
 

Surface syntax: Surface((width, height), flags=0, depth=0, masks=None) -> Surface

#Size currently set to 0x0
mapsurf = pygame.Surface ((0,0), pygame.HWSURFACE | pygame.SRCALPHA)

#Size same as window
mapsurf = pygame.Surface ((800,600), pygame.HWSURFACE | pygame.SRCALPHA)

 

Link to comment
Share on other sites

Link to post
Share on other sites

23 hours ago, elpiop said:

You specified a height and width of 0 for your map surface.  
Give it the same height and width as your window (or whatever you want), and you should see the texture.
 


Surface syntax: Surface((width, height), flags=0, depth=0, masks=None) -> Surface

#Size currently set to 0x0
mapsurf = pygame.Surface ((0,0), pygame.HWSURFACE | pygame.SRCALPHA)

#Size same as window
mapsurf = pygame.Surface ((800,600), pygame.HWSURFACE | pygame.SRCALPHA)

 

Thanks very much.

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

×