mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-11 13:23:00 +00:00
Increase logo size to 150% of display dimensions for dramatic effect
This commit is contained in:
@@ -117,8 +117,9 @@ class BaseNHLManager:
|
|||||||
logo = logo.convert('RGBA')
|
logo = logo.convert('RGBA')
|
||||||
|
|
||||||
# Calculate max size based on display dimensions
|
# Calculate max size based on display dimensions
|
||||||
max_width = self.display_width // 3 # Increased from 4 to 3 for larger logos
|
# Make logos 150% of display width to allow them to extend off screen
|
||||||
max_height = self.display_height // 2 # Half of display height
|
max_width = int(self.display_width * 1.5)
|
||||||
|
max_height = int(self.display_height * 1.5)
|
||||||
|
|
||||||
# Resize maintaining aspect ratio
|
# Resize maintaining aspect ratio
|
||||||
logo.thumbnail((max_width, max_height), Image.Resampling.LANCZOS)
|
logo.thumbnail((max_width, max_height), Image.Resampling.LANCZOS)
|
||||||
@@ -257,23 +258,49 @@ class BaseNHLManager:
|
|||||||
main_img = main_img.convert('RGB')
|
main_img = main_img.convert('RGB')
|
||||||
draw = ImageDraw.Draw(main_img)
|
draw = ImageDraw.Draw(main_img)
|
||||||
|
|
||||||
# Draw scores in the format "AWAY - HOME"
|
# Check if this is an upcoming game
|
||||||
home_score = str(self.current_game["home_score"])
|
is_upcoming = self.current_game.get("is_upcoming", False)
|
||||||
away_score = str(self.current_game["away_score"])
|
|
||||||
score_text = f"{away_score} - {home_score}"
|
|
||||||
|
|
||||||
# Calculate position for the score text (centered at the bottom)
|
if is_upcoming:
|
||||||
score_width = draw.textlength(score_text, font=self.fonts['score'])
|
# For upcoming games, show date and time
|
||||||
score_x = (self.display_width - score_width) // 2
|
game_date = self.current_game.get("game_date", "")
|
||||||
score_y = self.display_height - 15
|
game_time = self.current_game.get("game_time", "")
|
||||||
draw.text((score_x, score_y), score_text, font=self.fonts['score'], fill=(255, 255, 255))
|
date_time_text = f"{game_date} {game_time}"
|
||||||
|
|
||||||
|
# Calculate position for the date/time text (centered at the bottom)
|
||||||
|
date_time_width = draw.textlength(date_time_text, font=self.fonts['time'])
|
||||||
|
date_time_x = (self.display_width - date_time_width) // 2
|
||||||
|
date_time_y = self.display_height - 15
|
||||||
|
draw.text((date_time_x, date_time_y), date_time_text, font=self.fonts['time'], fill=(255, 255, 255))
|
||||||
|
|
||||||
|
# Show "Upcoming Game" at the top
|
||||||
|
status_text = "Upcoming Game"
|
||||||
|
status_width = draw.textlength(status_text, font=self.fonts['status'])
|
||||||
|
status_x = (self.display_width - status_width) // 2
|
||||||
|
status_y = 5
|
||||||
|
draw.text((status_x, status_y), status_text, font=self.fonts['status'], fill=(255, 255, 255))
|
||||||
|
else:
|
||||||
|
# For live/final games, show scores and period/time
|
||||||
|
home_score = str(self.current_game.get("home_score", "0"))
|
||||||
|
away_score = str(self.current_game.get("away_score", "0"))
|
||||||
|
score_text = f"{away_score} - {home_score}"
|
||||||
|
|
||||||
|
# Calculate position for the score text (centered at the bottom)
|
||||||
|
score_width = draw.textlength(score_text, font=self.fonts['score'])
|
||||||
|
score_x = (self.display_width - score_width) // 2
|
||||||
|
score_y = self.display_height - 15
|
||||||
|
draw.text((score_x, score_y), score_text, font=self.fonts['score'], fill=(255, 255, 255))
|
||||||
|
|
||||||
# Draw game status
|
# Draw period and time
|
||||||
status_text = self.current_game.get("status_text", "")
|
period = self.current_game.get("period", 0)
|
||||||
status_width = draw.textlength(status_text, font=self.fonts['status'])
|
clock = self.current_game.get("clock", "0:00")
|
||||||
status_x = (self.display_width - status_width) // 2
|
period_text = f"Period {period} {clock}"
|
||||||
status_y = 5
|
|
||||||
draw.text((status_x, status_y), status_text, font=self.fonts['status'], fill=(255, 255, 255))
|
# Calculate position for the period text (centered at the top)
|
||||||
|
period_width = draw.textlength(period_text, font=self.fonts['time'])
|
||||||
|
period_x = (self.display_width - period_width) // 2
|
||||||
|
period_y = 5
|
||||||
|
draw.text((period_x, period_y), period_text, font=self.fonts['time'], fill=(255, 255, 255))
|
||||||
|
|
||||||
# Display the image
|
# Display the image
|
||||||
self.display_manager.image.paste(main_img, (0, 0))
|
self.display_manager.image.paste(main_img, (0, 0))
|
||||||
|
|||||||
Reference in New Issue
Block a user