'BLUE': ('glyphs/key.png', PALETTE.BLUE),
'CLOCKWISE': ('glyphs/clockwise.png', None),
'ANTICLOCKWISE': ('glyphs/anticlockwise.png', None),
+ 'SHIFT_LEFT': ('glyphs/shift_left.png', None),
+ 'SHIFT_RIGHT': ('glyphs/shift_right.png', None),
'HEALTH_NOCOLOUR': ('glyphs/health.png', None),
'WINTOKEN_NOCOLOUR': ('glyphs/win.png', None),
self.border_colour = convert_colour(kwargs.pop('border_colour',
PALETTE.BLACK))
self.box_width = kwargs.pop('box_width', 0)
- self.centre = kwargs.pop('centre', False)
+
+ self.full_width = kwargs.pop('full_width', True)
super(TextBoxWidget, self).__init__(*args, **kwargs)
width = max(width, line_rect.width + self.padding * 2)
height += line_rect.height
+ if self.full_width:
+ width = max(width, self.box_width)
+
self.surface = pygame.surface.Surface((width, height),
pygame.locals.SRCALPHA)
self.surface.fill(self.bg_colour)
x, y = self.padding, self.padding
for line_surface in rendered_lines:
- if self.centre and self.box_width:
+ if self.centre:
x = (width - line_surface.get_rect().width) / 2
x += self.padding
- print x, width, line_surface.get_rect().width
self.surface.blit(line_surface, (x, y))
y += line_surface.get_rect().height
for pos, img in image_map.items():