Skip to content

Commit

Permalink
Cahnged the system default font to MCEdit one when splash screen can'…
Browse files Browse the repository at this point in the history
…t be loaded. Also added a fallback when this not work.
  • Loading branch information
LaChal committed Apr 16, 2015
1 parent 55bfdd4 commit f9be7ab
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions splash.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@
screen = pygame.display.set_mode(splash.get_size(),pygame.NOFRAME)
screen.blit(splash, (0,0))
except:
font = pygame.font.Font(pygame.font.get_default_font(), 48)
buf = font.render("MCEDit is loading...", True, (128, 128, 128))
screen = pygame.display.set_mode((buf.get_width() + 20, buf.get_height() + 20), pygame.NOFRAME)
screen.blit(buf, (10, 10))
splash = pygame.display.get_surface()
try;
font = pygame.font.Font(os.path.join('.', 'fonts', 'DejaVuSans-Bold.ttf'), 48)
buf = font.render("MCEDit is loading...", True, (128, 128, 128))
screen = pygame.display.set_mode((buf.get_width() + 20, buf.get_height() + 20), pygame.NOFRAME)
screen.blit(buf, (10, 10))
splash = pygame.display.get_surface()
except:
splash = pygame.display.set_mode((1, 1))
no_splash = True
pygame.display.update()
os.environ['SDL_VIDEO_CENTERED'] = '0'
Expand Down

0 comments on commit f9be7ab

Please sign in to comment.