|
From: <jo...@us...> - 2011-11-14 21:00:53
|
Revision: 2
http://pacemaker.svn.sourceforge.net/pacemaker/?rev=2&view=rev
Author: johnb0b
Date: 2011-11-14 21:00:47 +0000 (Mon, 14 Nov 2011)
Log Message:
-----------
Correction du bug d'affichage des boutons, Order de la list des jeux, Ajout de la description des jeux dans le panel a droite. ATTENTION: si la description est trop longue, il n'y a aucun retour a la ligne qui se fait. Il faut trouver un moyen de faire ?\195?\167a ?\195?\169l?\195?\169gament. Nico: J'utilise la m?\195?\170me font? Quelle taille? Quelle couleur?
Modified Paths:
--------------
config.ini
elements/game.py
games/Jeu1/game.ini
ui-main.py
Modified: config.ini
===================================================================
--- config.ini 2011-11-13 01:46:12 UTC (rev 1)
+++ config.ini 2011-11-14 21:00:47 UTC (rev 2)
@@ -11,6 +11,7 @@
button-click = ./res/img/button_click.png
font = ./res/fonts/Cuprum.otf
font-size = 25
+font-descr-size = 14
collide-zone-x = 8
collide-zone-y = 7
collide-zone-width = 250
Modified: elements/game.py
===================================================================
--- elements/game.py 2011-11-13 01:46:12 UTC (rev 1)
+++ elements/game.py 2011-11-14 21:00:47 UTC (rev 2)
@@ -18,6 +18,8 @@
self._coord = self.determine_coordonate()
self._font = self._main_config.get('buttons', 'font')
self._collide_rect = Rect(self._coord[0] + self._main_config.getint('buttons', 'collide-zone-x') , self._coord[1] + self._main_config.getint('buttons', 'collide-zone-y'), self._main_config.getint('buttons', 'collide-zone-width'), self._main_config.getint('buttons', 'collide-zone-height'))
+ self._descr_surface = None
+ self._hl = False
self.print_name()
@@ -27,12 +29,17 @@
def handle_event(self, mouse_pos):
if self._collide_rect.collidepoint(mouse_pos):
self._current_image = self._image_hl
+ self._hl = True
else:
self._current_image = self._image_base
+ self._hl = False
def draw(self, screen):
screen.blit(self._current_image, self._coord)
+ if (self._hl):
+ screen.blit(self._descr_surface, [814, 148])
+
def print_name(self):
#TODO: Mettre dans un fichier config
@@ -41,14 +48,16 @@
self._image_base.blit(name, (20,25))
self._image_hl.blit(name, (20,25))
self._image_click.blit(name, (20,25))
+ 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])
def determine_coordonate(self):
- if self._number % 3 == 1 :
- x = 533
- elif self._number % 3 == 2:
+ if self._number % 3 == 0 :
+ x = 11
+ elif self._number % 3 == 1:
x = 272
else:
- x = 11
+ x = 533
y = (math.floor(self._number / 3) * 67) + 41
Modified: games/Jeu1/game.ini
===================================================================
--- games/Jeu1/game.ini 2011-11-13 01:46:12 UTC (rev 1)
+++ games/Jeu1/game.ini 2011-11-14 21:00:47 UTC (rev 2)
@@ -1,3 +1,3 @@
[general]
name = Jeu 1
-description = Un jeu trop cool trop bien
+description = Un jeu trop cool \ntrop bien
Modified: ui-main.py
===================================================================
--- ui-main.py 2011-11-13 01:46:12 UTC (rev 1)
+++ ui-main.py 2011-11-14 21:00:47 UTC (rev 2)
@@ -68,6 +68,7 @@
games = []
games_list = os.listdir(games_path)
position = 0
+ games_list.sort()
for game_folder in games_list:
game_folder_path = os.path.join(games_path,game_folder)
game_ini_file = os.path.join(game_folder_path, 'game.ini')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|