From: Stefano Rivera Date: Fri, 16 May 2014 21:25:25 +0000 (+0200) Subject: Set a window icon and title X-Git-Tag: 0.1~177 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=05dec9325297def585919056b4c158d80856903c;p=naja.git Set a window icon and title --- diff --git a/data/icons/robot_24.png b/data/icons/robot_24.png new file mode 100644 index 0000000..72749c0 Binary files /dev/null and b/data/icons/robot_24.png differ diff --git a/naja/__main__.py b/naja/__main__.py index 44d1a06..7bc1442 100644 --- a/naja/__main__.py +++ b/naja/__main__.py @@ -7,6 +7,7 @@ from naja.constants import SCREEN from naja.engine import Engine from naja.sound import sound from naja.options import parse_args +from naja.resources.loader import Loader from naja.scenes.menu import MenuScene @@ -16,8 +17,14 @@ def main(): pygame.display.init() pygame.font.init() + # set_icon needs to be called before set_mode on some platforms, but we + # can't use convert_alpha until we've created a window with set_mode + r = Loader('data') + r.CONVERT_ALPHA = False + pygame.display.set_icon(r.get_image('robot_24.png', basedir='icons')) + pygame.display.set_mode(SCREEN, pgl.SWSURFACE) - pygame.display.set_caption('Naja') + pygame.display.set_caption('Robolock II') sound.init() screen = pygame.display.get_surface()