@@ -48,21 +48,65 @@ def __init__(self, frame=None, **kwargs):
4848
4949 # TODO, make these work for a rotated frame
5050 def get_frame_height (self ):
51+ """Returns the height of the frame.
52+
53+ Returns
54+ -------
55+ float
56+ The height of the frame.
57+ """
5158 return self .frame .get_height ()
5259
5360 def get_frame_width (self ):
61+ """Returns the width of the frame
62+
63+ Returns
64+ -------
65+ float
66+ The width of the frame.
67+ """
5468 return self .frame .get_width ()
5569
5670 def get_frame_center (self ):
71+ """Returns the centerpoint of the frame in cartesian coordinates.
72+
73+ Returns
74+ -------
75+ np.array
76+ The cartesian coordinates of the center of the frame.
77+ """
5778 return self .frame .get_center ()
5879
5980 def set_frame_height (self , frame_height ):
81+ """Sets the height of the frame in MUnits.
82+
83+ Parameters
84+ ----------
85+ frame_height : int, float
86+ The new frame_height.
87+ """
6088 self .frame .stretch_to_fit_height (frame_height )
6189
6290 def set_frame_width (self , frame_width ):
91+ """Sets the width of the frame in MUnits.
92+
93+ Parameters
94+ ----------
95+ frame_width : int, float
96+ The new frame_width.
97+ """
6398 self .frame .stretch_to_fit_width (frame_width )
6499
65100 def set_frame_center (self , frame_center ):
101+ """Sets the centerpoint of the frame.
102+
103+ Parameters
104+ ----------
105+ frame_center : np.array, list, tuple, Mobject
106+ The point to which the frame must be moved.
107+ If is of type mobject, the frame will be moved to
108+ the center of that mobject.
109+ """
66110 self .frame .move_to (frame_center )
67111
68112 def capture_mobjects (self , mobjects , ** kwargs ):
@@ -74,9 +118,19 @@ def capture_mobjects(self, mobjects, **kwargs):
74118 # context used for updating should be regenerated
75119 # at each frame. So no caching.
76120 def get_cached_cairo_context (self , pixel_array ):
121+ """
122+ Since the frame can be moving around, the cairo
123+ context used for updating should be regenerated
124+ at each frame. So no caching.
125+ """
77126 return None
78127
79128 def cache_cairo_context (self , pixel_array , ctx ):
129+ """
130+ Since the frame can be moving around, the cairo
131+ context used for updating should be regenerated
132+ at each frame. So no caching.
133+ """
80134 pass
81135
82136 # def reset_frame_center(self):
@@ -94,5 +148,9 @@ def get_mobjects_indicating_movement(self):
94148 """
95149 Returns all mobjets whose movement implies that the camera
96150 should think of all other mobjects on the screen as moving
151+
152+ Returns
153+ -------
154+ list
97155 """
98156 return [self .frame ]
0 commit comments