My Pygame Game Engine
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

More updates to gui.py and fallback screen

Fixed fallback screen to be dynamic with screen size and fixed misstype in gui_text in gui.py that made the percentage_constraint for the y position adjust according to the width instead of the height as its supposed to do.

WillM e20dee44 f3519a86

+7 -5
src/scripts/__pycache__/__init__.cpython-39.pyc

This is a binary file and will not be displayed.

src/scripts/__pycache__/game_manager.cpython-39.pyc

This is a binary file and will not be displayed.

src/scripts/modules/__pycache__/colors.cpython-39.pyc

This is a binary file and will not be displayed.

src/scripts/modules/__pycache__/debug.cpython-39.pyc

This is a binary file and will not be displayed.

src/scripts/modules/__pycache__/fonts.cpython-39.pyc

This is a binary file and will not be displayed.

src/scripts/modules/__pycache__/gui.cpython-39.pyc

This is a binary file and will not be displayed.

src/scripts/modules/__pycache__/image.cpython-39.pyc

This is a binary file and will not be displayed.

src/scripts/modules/__pycache__/input.cpython-39.pyc

This is a binary file and will not be displayed.

src/scripts/modules/__pycache__/language.cpython-39.pyc

This is a binary file and will not be displayed.

src/scripts/modules/__pycache__/math_utils.cpython-39.pyc

This is a binary file and will not be displayed.

src/scripts/modules/__pycache__/renderer.cpython-39.pyc

This is a binary file and will not be displayed.

src/scripts/modules/__pycache__/sound.cpython-39.pyc

This is a binary file and will not be displayed.

+3 -2
src/scripts/modules/gui.py
··· 320 if class_use == center_constraint: 321 self.y = self.parent.y + (self.parent.height / 2) - (self.size * (len(self.draw_text) - 1)) / 2 322 elif class_use == percentage_constraint: 323 - self.y = self.parent.y + (self.parent.width * self.y_constraint.value) 324 elif class_use == pixel_constraint: 325 self.y = self.parent.y + self.y_constraint.value 326 ··· 332 333 def render(self): 334 for i, item in enumerate(self.draw_text): 335 - img, rect = self.game.math.rotate_center(self.game.font_handler.render(item, 'default', self.size, self.color), 0, self.x, (self.y + self.size * i)) 336 self.game.renderer.main_surface.blit(img, rect) 337 338 class gui_toggle_button:
··· 320 if class_use == center_constraint: 321 self.y = self.parent.y + (self.parent.height / 2) - (self.size * (len(self.draw_text) - 1)) / 2 322 elif class_use == percentage_constraint: 323 + self.y = self.parent.y + (self.parent.height * self.y_constraint.value) 324 elif class_use == pixel_constraint: 325 self.y = self.parent.y + self.y_constraint.value 326 ··· 332 333 def render(self): 334 for i, item in enumerate(self.draw_text): 335 + #pygame.draw.circle(self.game.renderer.main_surface, (255, 0, 0), (self.x ,self.y) ,4) 336 + img, rect = self.game.math.rotate_center(self.game.font_handler.render(item, 'default', self.size, self.color), 0, self.x, ((self.y + self.size * i))) 337 self.game.renderer.main_surface.blit(img, rect) 338 339 class gui_toggle_button:
+4 -3
src/scripts/modules/renderer.py
··· 138 self.text = gui_text(game) 139 self.text.parent = self.rect 140 self.text.set_x_constraint(center_constraint()) 141 - self.text.set_y_constraint(percentage_constraint(0.25)) 142 self.text.size = 62 143 self.text.text = "Fallback Screen" 144 145 self.text2 = gui_text(game) 146 self.text2.parent = self.rect 147 self.text2.set_x_constraint(center_constraint()) 148 - self.text2.set_y_constraint(percentage_constraint(0.3)) 149 - self.text2.size = 23 150 self.text2.text = "This screen either appeared because you put in a \ninvalid name for a screen switch or you have no screen loaded.\nIf you think this is a bug create a issue on the Github page." 151 152 ## Redirect button
··· 138 self.text = gui_text(game) 139 self.text.parent = self.rect 140 self.text.set_x_constraint(center_constraint()) 141 + self.text.set_y_constraint(percentage_constraint(0.35)) 142 + self.text.set_size_constraint(percentage_constraint(0.1)) 143 self.text.size = 62 144 self.text.text = "Fallback Screen" 145 146 self.text2 = gui_text(game) 147 self.text2.parent = self.rect 148 self.text2.set_x_constraint(center_constraint()) 149 + self.text2.set_y_constraint(center_constraint()) 150 + self.text2.set_size_constraint(percentage_constraint(0.1)) 151 self.text2.text = "This screen either appeared because you put in a \ninvalid name for a screen switch or you have no screen loaded.\nIf you think this is a bug create a issue on the Github page." 152 153 ## Redirect button
src/scripts/screens/__pycache__/__init__.cpython-39.pyc

This is a binary file and will not be displayed.

src/scripts/screens/__pycache__/gui_test.cpython-39.pyc

This is a binary file and will not be displayed.