Changeset 598 for trunk/game/scripts/gamesceneview.py
- Timestamp:
- 07/24/10 17:48:44 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/game/scripts/gamesceneview.py
r584 r598 43 43 self.faded_objects = set() 44 44 45 def displayObjectText(self, obj , text):45 def displayObjectText(self, obj_id, text): 46 46 """Display on screen the text of the object over the object. 47 @type obj :fife.instance48 @param obj: object to draw over47 @type obj_id: id of fife.instance 48 @param obj: id of object to draw over 49 49 @type text: String 50 50 @param text: text to display over object 51 51 @return: None""" 52 obj.say(str(text), 1000) 52 try: 53 if obj_id: 54 obj = self.model.active_map.agent_layer.getInstance(obj_id) 55 else: 56 obj = None 57 except RuntimeError as error: 58 if error.args[0].split(',')[0].strip() == "_[NotFound]_": 59 obj = None 60 else: 61 raise 62 if obj: 63 obj.say(str(text), 1000) 53 64 54 65 def onWalk(self, click): … … 90 101 91 102 103 #def removeHighlight(self): 104 105 92 106 def highlightFrontObject(self, mouse_coords): 93 107 """Highlights the object that is at the … … 99 113 if front_obj != None: 100 114 if self.highlight_obj == None \ 101 or front_obj.getId() != \102 self.highlight_obj.getId():103 if self. highlight_obj:104 self.displayObjectText(self.highlight_obj, "")115 or front_obj.getId() != \ 116 self.highlight_obj: 117 if self.model.game_state.hasObject(front_obj.getId()): 118 self.displayObjectText(self.highlight_obj, "") 105 119 self.model.active_map.outline_renderer.removeAllOutlines() 106 self.highlight_obj = front_obj 120 self.highlight_obj = front_obj.getId() 107 121 self.model.active_map.outline_renderer.addOutlined( 108 self.highlight_obj,122 front_obj, 109 123 0, 110 124 137, 255, 2) 111 125 # get the text 112 item = self.model.objectActive( 113 self.highlight_obj.getId()) 126 item = self.model.objectActive(self.highlight_obj) 114 127 if item is not None: 115 128 self.displayObjectText(self.highlight_obj,
Note: See TracChangeset
for help on using the changeset viewer.