Skip to content

Commit

Permalink
Add up and down arrow by firmware select buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
SavageCore committed Jun 16, 2023
1 parent 185e449 commit 458c4c2
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 0 deletions.
Binary file added assets/icons/chevron-down-outline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions assets/icons/chevron-down-outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/chevron-up-outline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions assets/icons/chevron-up-outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions splash_screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ def __init__(self, screen, image_file, background_colour=(0, 0, 0), text="", pad
self.padding_bottom = padding_bottom
self.padding_left = padding_left
self.padding_right = padding_right
self.up_arrow_image = pygame.transform.scale(pygame.image.load(
"assets/icons/chevron-up-outline.png").convert_alpha(), (16, 16))
self.down_arrow_image = pygame.transform.scale(pygame.image.load(
"assets/icons/chevron-down-outline.png").convert_alpha(), (16, 16))

# Display the splash screen
def show(self):
Expand Down Expand Up @@ -73,6 +77,16 @@ def show(self):
# Blit the text onto the screen
self.screen.blit(text_surface, (text_x, text_y))

# Calculate the position to blit the arrow images
arrow_x = screen_width - self.padding_right - self.padding_right
arrow__up_y = 35
arrow__down_y = arrow__up_y + self.up_arrow_image.get_height() + 10

# Blit the arrow images onto the screen
self.screen.blit(self.up_arrow_image, (arrow_x, arrow__up_y))
self.screen.blit(self.down_arrow_image,
(arrow_x, arrow__down_y + self.up_arrow_image.get_height()))

pygame.display.update()

# Remove the splash screen
Expand Down

0 comments on commit 458c4c2

Please sign in to comment.