File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ def interact(self):
104104 self .quit_interaction = False
105105 self .lock_static_mobject_data ()
106106 while not (self .window .is_closing or self .quit_interaction ):
107- self .update_frame ()
107+ self .update_frame (1 / self . camera . frame_rate )
108108 if self .window .is_closing :
109109 self .window .destroy ()
110110 if self .quit_interaction :
@@ -248,6 +248,18 @@ def get_mobjects(self):
248248 def get_mobject_copies (self ):
249249 return [m .copy () for m in self .mobjects ]
250250
251+ def point_to_mobject (self , point , search_set = None , buff = 0 ):
252+ """
253+ E.g. if clicking on the scene, this returns the top layer mobject
254+ under a given point
255+ """
256+ if search_set is None :
257+ search_set = self .mobjects
258+ for mobject in reversed (search_set ):
259+ if mobject .is_point_touching (point , buff = buff ):
260+ return mobject
261+ return None
262+
251263 # Related to skipping
252264 def update_skipping_status (self ):
253265 if self .start_at_animation_number is not None :
You can’t perform that action at this time.
0 commit comments