comparison tools/area_editor.py @ 198:05c2c592ce2e

Add dummy check boxes
author Neil Muller <drnlmuller@gmail.com>
date Tue, 03 Sep 2013 22:19:20 +0200
parents b8701c0bb184
children c291fd4b49bf
comparison
equal deleted inserted replaced
197:34c11bb5c96e 198:05c2c592ce2e
21 21
22 import pymunk 22 import pymunk
23 23
24 from albow.root import RootWidget 24 from albow.root import RootWidget
25 from albow.widget import Widget 25 from albow.widget import Widget
26 from albow.controls import Button 26 from albow.controls import Button, Label, CheckBox
27 from albow.dialogs import alert 27 from albow.dialogs import alert
28 28
29 from nagslang.constants import SCREEN 29 from nagslang.constants import SCREEN
30 from nagslang.level import Level, POLY_COLORS 30 from nagslang.level import Level, POLY_COLORS
31 31
302 y += MENU_BUTTON_HEIGHT + MENU_PAD 302 y += MENU_BUTTON_HEIGHT + MENU_PAD
303 self.add(but) 303 self.add(but)
304 304
305 button_rect = pygame.rect.Rect(0, 0, MENU_WIDTH, MENU_BUTTON_HEIGHT) 305 button_rect = pygame.rect.Rect(0, 0, MENU_WIDTH, MENU_BUTTON_HEIGHT)
306 306
307 check_rect = pygame.rect.Rect(0, 0, MENU_BUTTON_HEIGHT // 2,
308 MENU_BUTTON_HEIGHT // 2)
309
307 end_poly_but = PolyButton(None, self.level_widget) 310 end_poly_but = PolyButton(None, self.level_widget)
308 end_poly_but.rect = button_rect.copy() 311 end_poly_but.rect = button_rect.copy()
309 end_poly_but.rect.move_ip(MENU_LEFT, y) 312 end_poly_but.rect.move_ip(MENU_LEFT, y)
310 self.add(end_poly_but) 313 self.add(end_poly_but)
311 y += MENU_BUTTON_HEIGHT + MENU_PAD 314 y += MENU_BUTTON_HEIGHT + MENU_PAD
326 action=self.level_widget.close_poly) 329 action=self.level_widget.close_poly)
327 close_poly_but.rect = button_rect.copy() 330 close_poly_but.rect = button_rect.copy()
328 close_poly_but.rect.move_ip(MENU_LEFT, y) 331 close_poly_but.rect.move_ip(MENU_LEFT, y)
329 self.add(close_poly_but) 332 self.add(close_poly_but)
330 y += MENU_BUTTON_HEIGHT + MENU_PAD 333 y += MENU_BUTTON_HEIGHT + MENU_PAD
334
335 white = pygame.color.Color("white")
336 self.show_objs = CheckBox(fg_color=white)
337 self.show_objs.rect = check_rect.copy()
338 self.show_objs.rect.move_ip(MENU_LEFT, y)
339 label = Label("Show Objects", fg_color=white)
340 label.rect.move_ip(MENU_LEFT + MENU_BUTTON_HEIGHT // 2 + MENU_PAD, y)
341 self.add(self.show_objs)
342 self.add(label)
343 y += label.rect.height + MENU_PAD
344
345 self.show_enemies = CheckBox(fg_color=white)
346 self.show_enemies.rect = check_rect.copy()
347 self.show_enemies.rect.move_ip(MENU_LEFT, y)
348 label = Label("Show enemy start pos", fg_color=white)
349 label.rect.move_ip(MENU_LEFT + MENU_BUTTON_HEIGHT // 2 + MENU_PAD, y)
350 self.add(self.show_enemies)
351 self.add(label)
352 y += label.rect.height + MENU_PAD
331 353
332 quit_but = Button('Quit', action=self.quit) 354 quit_but = Button('Quit', action=self.quit)
333 quit_but.rect = button_rect.copy() 355 quit_but.rect = button_rect.copy()
334 quit_but.rect.move_ip(MENU_LEFT, y) 356 quit_but.rect.move_ip(MENU_LEFT, y)
335 self.add(quit_but) 357 self.add(quit_but)