import pygame.locals as pgl
from naja.constants import INFO_SIZE, EIGHT_BIT_SCALE, MOVE, ACT, KEYS
import pygame.locals as pgl
from naja.constants import INFO_SIZE, EIGHT_BIT_SCALE, MOVE, ACT, KEYS
self.surface = pygame.surface.Surface(INFO_SIZE)
self.surface.fill((0, 0, 0))
# Extract actions and such from the card
self.surface = pygame.surface.Surface(INFO_SIZE)
self.surface.fill((0, 0, 0))
# Extract actions and such from the card
box_width=(INFO_SIZE[0] - 12) // EIGHT_BIT_SCALE,
fontsize=28)
text.render(self.surface)
box_width=(INFO_SIZE[0] - 12) // EIGHT_BIT_SCALE,
fontsize=28)
text.render(self.surface)
if choice == self.chosen:
colour = (255, 255, 0, 128)
bottom = y_offset + text.surface.get_rect().height
if choice == self.chosen:
colour = (255, 255, 0, 128)
bottom = y_offset + text.surface.get_rect().height
def set_position(self, position):
self.card = self.state.board_locations[position]
def set_position(self, position):
self.card = self.state.board_locations[position]
def draw(self, surface):
surface.blit(self.surface, self.pos)
def handle_event(self, ev):
def draw(self, surface):
surface.blit(self.surface, self.pos)
def handle_event(self, ev):
if self.state.gameboard.player_mode == MOVE:
return super(InfoAreaWidget, self).handle_event(ev)
if ev.type == pgl.KEYDOWN:
if ev.key in KEYS.SELECT:
if self.state.gameboard.player_mode == MOVE:
return super(InfoAreaWidget, self).handle_event(ev)
if ev.type == pgl.KEYDOWN:
if ev.key in KEYS.SELECT:
action.perform_action(self.state.gameboard, self.card)
self.state.gameboard.replace_card(player.position)
self.state.gameboard.change_mode()
action.perform_action(self.state.gameboard, self.card)
self.state.gameboard.replace_card(player.position)
self.state.gameboard.change_mode()