annotate pyntnclick/scenewidgets.py @ 548:ded4324b236e pyntnclick

Moved stuff around, broke everything.
author Jeremy Thurgood <firxen@gmail.com>
date Sat, 11 Feb 2012 13:10:18 +0200
parents gamelib/scenewidgets.py@42742a62f9c3
children 38fb04728ac5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
525
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
1 """Interactive elements within a Scene."""
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
2
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
3
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
4 from pygame import Rect
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
5 from pygame.color import Color
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
6 from pygame.colordict import THECOLORS
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
7 from pygame.surface import Surface
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
8 from albow.resource import get_image
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
9
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
10 from gamelib.state import Thing
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
11 from gamelib.constants import DEBUG
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
12 from gamelib.widgets import BoomLabel
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
13
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
14
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
15 class Interact(object):
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
16
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
17 def __init__(self, image, rect, interact_rect):
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
18 self.image = image
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
19 self.rect = rect
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
20 self.interact_rect = interact_rect
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
21
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
22 def set_thing(self, thing):
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
23 pass
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
24
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
25 def draw(self, surface):
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
26 if self.image is not None:
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
27 surface.blit(self.image, self.rect, None)
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
28
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
29 def animate(self):
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
30 return False
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
31
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
32
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
33 class InteractNoImage(Interact):
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
34
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
35 def __init__(self, x, y, w, h):
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
36 super(InteractNoImage, self).__init__(None, None, Rect(x, y, w, h))
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
37
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
38
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
39 class InteractText(Interact):
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
40 """Display box with text to interact with -- mostly for debugging."""
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
41
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
42 def __init__(self, x, y, text, bg_color=None):
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
43 if bg_color is None:
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
44 bg_color = (127, 127, 127)
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
45 label = BoomLabel(text)
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
46 label.set_margin(5)
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
47 label.border_width = 1
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
48 label.border_color = (0, 0, 0)
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
49 label.bg_color = bg_color
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
50 label.fg_color = (0, 0, 0)
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
51 image = Surface(label.size)
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
52 rect = Rect((x, y), label.size)
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
53 label.draw_all(image)
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
54 super(InteractText, self).__init__(image, rect, rect)
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
55
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
56
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
57 class InteractRectUnion(Interact):
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
58
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
59 def __init__(self, rect_list):
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
60 # pygame.rect.Rect.unionall should do this, but is broken
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
61 # in some pygame versions (including 1.8, it appears)
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
62 rect_list = [Rect(x) for x in rect_list]
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
63 union_rect = rect_list[0]
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
64 for rect in rect_list[1:]:
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
65 union_rect = union_rect.union(rect)
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
66 super(InteractRectUnion, self).__init__(None, None, union_rect)
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
67 self.interact_rect = rect_list
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
68
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
69
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
70 class InteractImage(Interact):
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
71
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
72 def __init__(self, x, y, image_name):
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
73 super(InteractImage, self).__init__(None, None, None)
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
74 self._pos = (x, y)
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
75 self._image_name = image_name
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
76
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
77 def set_thing(self, thing):
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
78 self.image = get_image(thing.folder, self._image_name)
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
79 self.rect = Rect(self._pos, self.image.get_size())
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
80 self.interact_rect = self.rect
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
81
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
82
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
83 class InteractImageRect(InteractImage):
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
84 def __init__(self, x, y, image_name, r_x, r_y, r_w, r_h):
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
85 super(InteractImageRect, self).__init__(x, y, image_name)
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
86 self._r_pos = (r_x, r_y)
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
87 self._r_size = (r_w, r_h)
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
88
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
89 def set_thing(self, thing):
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
90 super(InteractImageRect, self).set_thing(thing)
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
91 self.interact_rect = Rect(self._r_pos, self._r_size)
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
92
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
93
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
94 class InteractAnimated(Interact):
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
95 """Interactive with an animation rather than an image"""
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
96
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
97 # FIXME: Assumes all images are the same size
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
98 # anim_seq - sequence of image names
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
99 # delay - number of frames to wait between changing images
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
100
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
101 def __init__(self, x, y, anim_seq, delay):
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
102 self._pos = (x, y)
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
103 self._anim_pos = 0
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
104 self._names = anim_seq
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
105 self._frame_count = 0
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
106 self._anim_seq = None
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
107 self._delay = delay
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
108
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
109 def set_thing(self, thing):
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
110 self._anim_seq = [get_image(thing.folder, x) for x in self._names]
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
111 self.image = self._anim_seq[0]
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
112 self.rect = Rect(self._pos, self.image.get_size())
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
113 self.interact_rect = self.rect
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
114
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
115 def animate(self):
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
116 if self._anim_seq:
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
117 self._frame_count += 1
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
118 if self._frame_count > self._delay:
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
119 self._frame_count = 0
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
120 self._anim_pos += 1
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
121 if self._anim_pos >= len(self._anim_seq):
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
122 self._anim_pos = 0
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
123 self.image = self._anim_seq[self._anim_pos]
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
124 # queue redraw
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
125 return True
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
126 return False
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
127
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
128
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
129 class GenericDescThing(Thing):
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
130 "Thing with an InteractiveUnionRect and a description"
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
131
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
132 INITIAL = "description"
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
133
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
134 def __init__(self, prefix, number, description, areas):
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
135 super(GenericDescThing, self).__init__()
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
136 self.description = description
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
137 self.name = '%s.%s' % (prefix, number)
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
138 self.interacts = {
533
42742a62f9c3 More pep8 cleanups
Neil Muller <neil@dip.sun.ac.za>
parents: 525
diff changeset
139 'description': InteractRectUnion(areas)
525
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
140 }
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
141 if DEBUG:
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
142 # Individual colors to make debugging easier
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
143 self._interact_hilight_color = Color(THECOLORS.keys()[number])
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
144
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
145 def get_description(self):
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
146 return self.description
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
147
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
148 def is_interactive(self, tool=None):
821b322e903b Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
149 return False