|
From: <kho...@us...> - 2011-11-15 14:52:11
|
Revision: 3
http://pacemaker.svn.sourceforge.net/pacemaker/?rev=3&view=rev
Author: kholonet
Date: 2011-11-15 14:51:58 +0000 (Tue, 15 Nov 2011)
Log Message:
-----------
Added banners for games and description text shades
Modified Paths:
--------------
config.ini
elements/game.py
ui-main.py
Added Paths:
-----------
games/Jeu1/ui_ban.png
games/Jeu2/ui_ban.png
games/Jeu3/ui_ban.png
games/Jeu4/ui_ban.png
Modified: config.ini
===================================================================
--- config.ini 2011-11-14 21:00:47 UTC (rev 2)
+++ config.ini 2011-11-15 14:51:58 UTC (rev 3)
@@ -19,4 +19,4 @@
[games-config]
-games_path=./games/
\ No newline at end of file
+games_path=./games/
Modified: elements/game.py
===================================================================
--- elements/game.py 2011-11-14 21:00:47 UTC (rev 2)
+++ elements/game.py 2011-11-15 14:51:58 UTC (rev 3)
@@ -6,13 +6,14 @@
class GameElement:
- def __init__(self, name, description, main_config, position):
+ def __init__(self, name, description, main_config, position, ban):
self._name = name
self._description = description
self._main_config = main_config
self._image_base = pygame.image.load(self._main_config.get('buttons', 'button-base')).convert_alpha()
self._image_hl = pygame.image.load(self._main_config.get('buttons', 'button-hl')).convert_alpha()
self._image_click = pygame.image.load(self._main_config.get('buttons', 'button-click')).convert_alpha()
+ self._image_ban = pygame.image.load(ban).convert_alpha()
self._current_image = self._image_base
self._number = position
self._coord = self.determine_coordonate()
@@ -38,18 +39,23 @@
def draw(self, screen):
screen.blit(self._current_image, self._coord)
if (self._hl):
+ screen.blit(self._descr_surface_shade, [815, 147])
screen.blit(self._descr_surface, [814, 148])
def print_name(self):
- #TODO: Mettre dans un fichier config
- font = pygame.font.Font(self._font, self._main_config.getint('buttons','font-size'))
- name = font.render(self._name, True, [191, 191, 191])
- self._image_base.blit(name, (20,25))
- self._image_hl.blit(name, (20,25))
- self._image_click.blit(name, (20,25))
+ #TODO: Put in a configuration file
+ #font = pygame.font.Font(self._font, self._main_config.getint('buttons','font-size'))
+ #name = font.render(self._name, True, [191, 191, 191])
+ #self._image_base.blit(name, (20,25))
+ #self._image_hl.blit(name, (20,25))
+ #self._image_click.blit(name, (20,25))
+ self._image_base.blit(self._image_ban, (13,12))
+ self._image_hl.blit(self._image_ban, (13,12))
+ self._image_click.blit(self._image_ban, (13,12))
font = pygame.font.Font(self._font, self._main_config.getint('buttons','font-descr-size'))
self._descr_surface = font.render(self._description, True, [191, 191, 191])
+ self._descr_surface_shade = font.render(self._description, True, [20, 20, 20])
def determine_coordonate(self):
if self._number % 3 == 0 :
@@ -65,4 +71,4 @@
-
\ No newline at end of file
+
Added: games/Jeu1/ui_ban.png
===================================================================
(Binary files differ)
Property changes on: games/Jeu1/ui_ban.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: games/Jeu2/ui_ban.png
===================================================================
(Binary files differ)
Property changes on: games/Jeu2/ui_ban.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: games/Jeu3/ui_ban.png
===================================================================
(Binary files differ)
Property changes on: games/Jeu3/ui_ban.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: games/Jeu4/ui_ban.png
===================================================================
(Binary files differ)
Property changes on: games/Jeu4/ui_ban.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: ui-main.py
===================================================================
--- ui-main.py 2011-11-14 21:00:47 UTC (rev 2)
+++ ui-main.py 2011-11-15 14:51:58 UTC (rev 3)
@@ -13,20 +13,20 @@
pygame.display.set_caption("PACEMaker")
screen = pygame.display.set_mode(size)
- # Chargement du fichier de configuration
+ # Load the configuration file
config = ConfigParser()
config.read('config.ini')
- # Récupération du chemin des images
+ # Get the UI images path
images_path = config.get('ui-images', 'images_path')
background_path = os.path.join(images_path, config.get('ui-images', 'bg_image_name'))
frame_path = os.path.join(images_path, config.get('ui-images', 'frame_image_name'))
- # Chargement des images de l'ui
+ # Load UI graphics
background = pygame.image.load(background_path).convert_alpha()
frame = pygame.image.load(frame_path).convert_alpha()
- # Mise à jour de la liste des jeux
+ # Updating the game list
games = load_games(config, config.get('games-config','games_path'))
for game in games:
print(game)
@@ -71,21 +71,22 @@
games_list.sort()
for game_folder in games_list:
game_folder_path = os.path.join(games_path,game_folder)
+ ban = os.path.join(game_folder_path, 'ui_ban.png')
game_ini_file = os.path.join(game_folder_path, 'game.ini')
print("Recherche de ",game_ini_file)
for infile in glob.glob(game_ini_file):
- games.append(create_game_menu_item(config, game_ini_file, position))
+ games.append(create_game_menu_item(config, game_ini_file, position, ban))
position+=1
return games
-def create_game_menu_item(main_config, game_path, position):
+def create_game_menu_item(main_config, game_path, position, ban):
print(game_path)
config = ConfigParser()
config.read(game_path)
- return GameElement(config.get('general', 'name'), config.get('general', 'description'), main_config, position)
+ return GameElement(config.get('general', 'name'), config.get('general', 'description'), main_config, position, ban)
if __name__ == '__main__':
- main()
\ No newline at end of file
+ main()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|