Mercurial > nagslang
changeset 516:b5838fb35db3
More polygon buttons
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Sat, 07 Sep 2013 19:48:48 +0200 |
parents | 1b1bd4f39e5c |
children | 51b5b8bf505a |
files | tools/area_editor.py |
diffstat | 1 files changed, 10 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/tools/area_editor.py Sat Sep 07 19:47:48 2013 +0200 +++ b/tools/area_editor.py Sat Sep 07 19:48:48 2013 +0200 @@ -884,7 +884,7 @@ def __init__(self, index, level_widget, parent): if index is not None: - text = "Draw: %s" % index + text = "P %s" % index else: text = 'Exit Draw Mode' super(PolyButton, self).__init__(text, parent) @@ -956,15 +956,19 @@ # Add poly buttons y = 5 - for poly in range(1, 7): + for poly in range(1, 10): but = PolyButton(poly, self.level_widget, self) - but.rect = pygame.rect.Rect(0, 0, MENU_WIDTH // 2 - MENU_PAD, + but.rect = pygame.rect.Rect(0, 0, MENU_WIDTH // 3 - MENU_PAD, MENU_BUTTON_HEIGHT) - if poly % 2: + index = poly % 3 + if index == 1: but.rect.move_ip(MENU_LEFT, y) + elif index == 2: + but.rect.move_ip(MENU_LEFT + MENU_WIDTH // 3 - MENU_HALF_PAD, + y) else: - but.rect.move_ip(MENU_LEFT + MENU_WIDTH // 2 - MENU_HALF_PAD, - y) + left = MENU_LEFT + 2 * MENU_WIDTH // 3 - MENU_HALF_PAD + but.rect.move_ip(left, y) y += MENU_BUTTON_HEIGHT + MENU_PAD self._light_buttons.append(but) widgets.append(but)