comparison pyntnclick/state.py @ 751:d5afaadbd821 pyntnclick

Remove frame_rect, it's the same as draw_rect_image
author Stefano Rivera <stefano@rivera.za.net>
date Sat, 26 Jan 2013 11:14:26 +0200
parents ef4bda7d623d
children 8ac05c038e73
comparison
equal deleted inserted replaced
750:ef4bda7d623d 751:d5afaadbd821
4 4
5 from widgets.text import LabelWidget 5 from widgets.text import LabelWidget
6 from pygame.color import Color 6 from pygame.color import Color
7 7
8 from pyntnclick.engine import ScreenEvent 8 from pyntnclick.engine import ScreenEvent
9 9 from pyntnclick.tools.utils import draw_rect_image
10
11 def frame_rect(surface, color, rect, thick=1):
12 # FIXME: Stolen from albow
13 surface.fill(color, (rect.left, rect.top, rect.width, thick))
14 surface.fill(color, (rect.left, rect.bottom - thick, rect.width, thick))
15 surface.fill(color, (rect.left, rect.top, thick, rect.height))
16 surface.fill(color, (rect.right - thick, rect.top, thick, rect.height))
17 10
18 11
19 class Result(object): 12 class Result(object):
20 """Result of interacting with a thing""" 13 """Result of interacting with a thing"""
21 14
489 self.current_interact.rect = old_rect.move(self.scene.OFFSET) 482 self.current_interact.rect = old_rect.move(self.scene.OFFSET)
490 self.current_interact.draw(surface) 483 self.current_interact.draw(surface)
491 self.current_interact.rect = old_rect 484 self.current_interact.rect = old_rect
492 if self.game.debug_rects and self._interact_hilight_color: 485 if self.game.debug_rects and self._interact_hilight_color:
493 if hasattr(self.rect, 'collidepoint'): 486 if hasattr(self.rect, 'collidepoint'):
494 frame_rect(surface, self._interact_hilight_color, 487 draw_rect_image(surface, self._interact_hilight_color,
495 self.rect.inflate(1, 1), 1) 488 self.rect.inflate(1, 1), 1)
496 else: 489 else:
497 for rect in self.rect: 490 for rect in self.rect:
498 frame_rect(surface, self._interact_hilight_color, 491 draw_rect_image(surface, self._interact_hilight_color,
499 rect.inflate(1, 1), 1) 492 rect.inflate(1, 1), 1)
500 493
501 494
502 class Item(GameDeveloperGizmo, InteractiveMixin): 495 class Item(GameDeveloperGizmo, InteractiveMixin):
503 """Base class for inventory items.""" 496 """Base class for inventory items."""