Changeset 134:2e1059b1a247


Ignore:
Timestamp:
Sep 2, 2013, 3:57:06 PM (7 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
rebase_source:
a3b2950c0551c735cf62fe0f9519a1a523301d21
Message:

Tweak button creation code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/area_editor.py

    r122 r134  
    229229            self.add(but)
    230230
     231        button_rect = pygame.rect.Rect(0, 0, MENU_WIDTH, MENU_BUTTON_HEIGHT)
     232
    231233        end_poly_but = PolyButton(None, self.level_widget)
    232         end_poly_but.rect = pygame.rect.Rect(0, 0, MENU_WIDTH,
    233                                              MENU_BUTTON_HEIGHT)
     234        end_poly_but.rect = button_rect.copy()
    234235        end_poly_but.rect.move_ip(MENU_LEFT, y)
    235236        self.add(end_poly_but)
     
    237238
    238239        fill_but = Button('Fill exterior', action=self.level_widget.set_filled)
    239         fill_but.rect = pygame.rect.Rect(0, 0, MENU_WIDTH, MENU_BUTTON_HEIGHT)
     240        fill_but.rect = button_rect.copy()
    240241        fill_but.rect.move_ip(MENU_LEFT, y)
    241242        self.add(fill_but)
     
    243244
    244245        save_but = Button('Save Level', action=self.save)
    245         save_but.rect = pygame.rect.Rect(0, 0, MENU_WIDTH, MENU_BUTTON_HEIGHT)
     246        save_but.rect = button_rect.copy()
    246247        save_but.rect.move_ip(MENU_LEFT, y)
    247248        self.add(save_but)
     
    249250
    250251        quit_but = Button('Quit', action=self.quit)
    251         quit_but.rect = pygame.rect.Rect(0, 0, MENU_WIDTH, MENU_BUTTON_HEIGHT)
     252        quit_but.rect = button_rect.copy()
    252253        quit_but.rect.move_ip(MENU_LEFT, y)
    253254        self.add(quit_but)
Note: See TracChangeset for help on using the changeset viewer.