Specifically the issue is getting the logo to show up with the transparency
logo = pygame.image.load(".//assets//LegendOfDragoonLogo.png").convert_alpha()
logo = pygame.transform.scale(logo,(400,300))
screen.blit(logo,(100,100))
Main Code:
import pygame
from pygame.locals import *
import os
# Game Initialization
pygame.init()
# Center the Game Application
os.environ['SDL_VIDEO_CENTERED'] = '1'
# Game Resolution
screen_width=800
screen_height=600
screen=pygame.display.set_mode((screen_width, screen_height))
# Text Renderer
def text_format(message, textSize, textColor):
newFont=pygame.font.Font(None, textSize)
newText=newFont.render(message, 0, textColor)
return newText
# Colors
white=(255, 255, 255)
black=(0, 0, 0)
gray=(50, 50, 50)
red=(255, 0, 0)
green=(0, 255, 0)
blue=(0, 0, 255)
yellow=(255, 255, 0)
# Game Framerate
clock = pygame.time.Clock()
FPS=30
def main_menu():
menu=True
selected="start"
while menu:
for event in pygame.event.get():
if event.type==pygame.QUIT:
pygame.quit()
quit()
if event.type==pygame.KEYDOWN:
if event.key==pygame.K_UP:
selected="start"
elif event.key==pygame.K_DOWN:
selected="quit"
if event.key==pygame.K_RETURN:
if selected=="start":
print("Start")
if selected=="quit":
pygame.quit()
quit()
# Main Menu UI
#screen.fill(blue)
logo = pygame.image.load(".//assets//LegendOfDragoonLogo.png").convert_alpha()
logo = pygame.transform.scale(logo,(400,300))
if selected=="start":
text_start=text_format("START", 75, white)
else:
text_start = text_format("START", 75, black)
if selected=="quit":
text_quit=text_format("QUIT", 75, white)
else:
text_quit = text_format("QUIT", 75, black)
start_rect=text_start.get_rect()
quit_rect=text_quit.get_rect()
# Main Menu Text
screen.blit(logo,(100,100))
screen.blit(text_start, (screen_width/2 - (start_rect[2]/2), 300))
screen.blit(text_quit, (screen_width/2 - (quit_rect[2]/2), 360))
pygame.display.update()
clock.tick(FPS)
pygame.display.set_caption("Legend of Dragoon")
main_menu()
pygame.quit()
quit()