Esempio n. 1
0
 def button_pressed(self, event, scene):
     screen_position = Vector(*event.pos)
     camera = scene.main_camera
     scene_position = camera.translate_to_frame(screen_position)
     btn = self.button_map.get(event.button)
     if btn is not None:
         return events.ButtonPressed(
             button=btn,
             position=scene_position,
             # TODO: Add frame position
         )
Esempio n. 2
0
 def button_pressed(self, event, scene):
     button = event.button
     screen_position = Vector(button.x, button.y)
     camera = scene.main_camera
     scene_position = camera.translate_point_to_game_space(screen_position)
     btn = self.button_map.get(button.button)
     if btn is not None:
         return events.ButtonPressed(
             button=btn,
             position=scene_position,
             # timestamp=motion.timestamp
         )