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
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
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)
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