![]() So that is why I figured it would be the best to make the tiles render out on a separate surface positioned in the middle of the screen surface. And then a second layer would be rendered in the middle of the screen which will be the game window and its width and height will be obviously smaller than the base layer.Īt the moment, the game is rendered from the top left corner of the screen until all the tiles have been rendered out. The base layer is the whole screen with some graphics on the sides added to it and a font displaying score. Checkbox Creating a checkbox: import PygameUtils as pu checkb pu. So for this to work, I would need a way to make "screen layers". Using the isOver(pos) function, you can check if a given position ((x, y) tuple, most likely the position of the mouse) is over the button, associating all kinds of pygame events to it (pygame.MOUSEBUTTONDOWN, pygame.MOUSEMOTION). I've attached an imageto illustrate what I'm looking for: UIBUTTONPRESSED : if selection : selection None else : selection event. However, I don't want the game window to lose it proportions so I figured I would add borders to the sides of the game window in order to support wide screens. I am working on a Tank game as a school project and I am trying to make it as user-friendly as possible (with things like customizable keybindings, display settings).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |