aboutsummaryrefslogtreecommitdiff
path: root/helpers
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2016-06-15 12:42:48 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2016-06-15 12:42:48 +0200
commit1b79473633242db1c180e07d7165a5bd837eb62e (patch)
tree880ebca415e57da6b6b548202a4f2cb07999da9b /helpers
parent4866eb9b13dc329c8a2bb53d410f5d779c165c76 (diff)
downloadMusicSampler-1b79473633242db1c180e07d7165a5bd837eb62e.tar.gz
MusicSampler-1b79473633242db1c180e07d7165a5bd837eb62e.tar.zst
MusicSampler-1b79473633242db1c180e07d7165a5bd837eb62e.zip
Allow to find files in pyinstaller
Diffstat (limited to 'helpers')
-rw-r--r--helpers/__init__.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/helpers/__init__.py b/helpers/__init__.py
index c42b378..7dbffdd 100644
--- a/helpers/__init__.py
+++ b/helpers/__init__.py
@@ -1,5 +1,6 @@
1# -*- coding: utf-8 -*- 1# -*- coding: utf-8 -*-
2from pygame import * 2from pygame import *
3import sys
3 4
4class Action: 5class Action:
5 action_types = [ 6 action_types = [
@@ -106,7 +107,11 @@ class Key:
106 def draw(self, background_surface): 107 def draw(self, background_surface):
107 self.surface = self.square().surface() 108 self.surface = self.square().surface()
108 109
109 police = font.Font("Ubuntu-Regular.ttf", 14) 110 if getattr(sys, 'frozen', False):
111 police = font.Font(sys._MEIPASS + "/Ubuntu-Regular.ttf", 14)
112 else:
113 police = font.Font("Ubuntu-Regular.ttf", 14)
114
110 text = police.render(self.key_sym, True, (0,0,0)) 115 text = police.render(self.key_sym, True, (0,0,0))
111 self.surface.blit(text, (5,5)) 116 self.surface.blit(text, (5,5))
112 background_surface.blit(self.surface, self.position) 117 background_surface.blit(self.surface, self.position)