consistent left alignment in the info area
[naja.git] / naja / widgets / info_area.py
index 2f75a635b3bb9096f329204020476174aabd123f..6f14ef7fa18e900cce30ac02186f1b262092077f 100644 (file)
@@ -5,7 +5,7 @@ import pygame
 import pygame.locals as pgl
 
 from naja.constants import (INFO_SIZE, EIGHT_BIT_SCALE, ACT, KEYS,
-                            EXAMINE, PALETTE)
+                            EXAMINE, PALETTE, INFO_LEFT_PADDING)
 from naja.events import finish_event
 from naja.resources import resources
 from naja.resources.mutators import EIGHT_BIT
@@ -48,7 +48,7 @@ class InfoAreaWidget(Widget):
         self.surface = pygame.surface.Surface(INFO_SIZE)
         self.surface.fill((0, 0, 0))
         # Extract actions and such from the card
-        title = TextWidget((0, 0), TITLES[self.state.gameboard.player_mode],
+        title = TextWidget((INFO_LEFT_PADDING, 0), TITLES[self.state.gameboard.player_mode],
                            colour=PALETTE.WHITE)
         title.render(self.surface)
         y_offset = title.surface.get_rect().height + 8
@@ -59,7 +59,7 @@ class InfoAreaWidget(Widget):
         if self.card.bitwise_operand:
             bits_text = '%s %s' % (
                 bits_text, bit_glyphs(self.card.bitwise_operand))
-        card_bits = TextBoxWidget((0, y_offset), bits_text,
+        card_bits = TextBoxWidget((INFO_LEFT_PADDING, y_offset), bits_text,
                                   box_width=INFO_SIZE[0],
                                   colour=PALETTE.LIGHT_TURQUOISE,
                                   bg_colour=PALETTE.BLACK)
@@ -77,11 +77,11 @@ class InfoAreaWidget(Widget):
         hint = TextBoxWidget((4, 0), hint_text, padding=2,
                              box_width=(INFO_SIZE[0] - 4) // EIGHT_BIT_SCALE)
         hint.prepare()
-        y_offset = INFO_SIZE[1] - hint.surface.get_rect().height
-        self.surface.blit(hint.surface, (4, y_offset))
+        y_offset = INFO_SIZE[1] - hint.surface.get_rect().height - INFO_LEFT_PADDING -2
+        self.surface.blit(hint.surface, (INFO_LEFT_PADDING, y_offset))
 
     def prepare_action(self, choice, action, y_offset):
-        x_offset = 18
+        x_offset = INFO_LEFT_PADDING
         action_viable = action.check_available(self.state.player)
         text_colour = PALETTE.BLACK if action_viable else PALETTE.GREY