@@ -55,31 +55,31 @@ class Camera2D:
5555 Replacing the camera data and projection data may break controllers. Their
5656 contents are exposed via properties rather than directly to prevent this.
5757
58- :param viewport: A 4-int tuple which defines the pixel bounds which the camera
59- will project to.
60- :param position: The 2D position of the camera in the XY plane .
61- :param up: A 2D vector which describes which direction is up
62- (defines the +Y-axis of the camera space) .
63- :param zoom: A scalar value which is inversely proportional to the size of the
64- camera projection. i.e. a zoom of 2.0 halves the size of the projection,
65- doubling the perceived size of objects .
66- :param projection: A 4-float tuple which defines the world space
67- bounds which the camera projects to the viewport.
68- :param near: The near clipping plane of the camera.
69- :param far: The far clipping plane of the camera .
70- :param render_target: The FrameBuffer that the camera uses. Defaults to the screen.
71- If the framebuffer is not the default screen nothing drawn after this camera is used will
72- show up. The FrameBuffer's internal viewport is ignored .
73- :param window: The Arcade Window to bind the camera to.
74- Defaults to the currently active window .
75-
76- :attributes:
77- * render_target - An optional framebuffer to activate at the same time as
78- the projection data, could be the screen, or an offscreen texture
79- * viewport - A rect which describes how the final projection should be mapped
80- from unit-space. defaults to the size of the render_target or window
81- * scissor - An optional rect which describes what pixels of the active render
82- target should be drawn to when undefined the viewport rect is used .
58+ Args:
59+ viewport:
60+ A 4-int tuple which defines the pixel bounds which the camera will project to .
61+ position:
62+ The 2D position of the camera in the XY plane .
63+ up:
64+ A 2D vector which describes which direction is up
65+ (defines the +Y-axis of the camera space) .
66+ zoom:
67+ A scalar value which is inversely proportional to the size of the
68+ camera projection. i.e. a zoom of 2.0 halves the size of the projection,
69+ doubling the perceived size of objects .
70+ projection:
71+ A 4-float tuple which defines the world space
72+ bounds which the camera projects to the viewport .
73+ near:
74+ The near clipping plane of the camera .
75+ far:
76+ The far clipping plane of the camera.
77+ render_target:
78+ The FrameBuffer that the camera uses. Defaults to the screen.
79+ If the framebuffer is not the default screen nothing drawn after this camera
80+ is used will show up. The FrameBuffer's internal viewport is ignored.
81+ window:
82+ The Arcade Window to bind the camera to. Defaults to the currently active window .
8383 """
8484
8585 def __init__ (
@@ -98,6 +98,10 @@ def __init__(
9898 ):
9999 self ._window : Window = window or get_window ()
100100 self .render_target : Framebuffer | None = render_target
101+ """
102+ An optional framebuffer to activate at the same time as
103+ the projection data, could be the screen, or an offscreen texture
104+ """
101105
102106 # We don't want to force people to use a render target,
103107 # but we need to have some form of default size.
@@ -140,7 +144,16 @@ def __init__(
140144 )
141145
142146 self .viewport : Rect = viewport or LRBT (0 , 0 , width , height )
147+ """
148+ A rect which describes how the final projection should be mapped
149+ from unit-space. defaults to the size of the render_target or window
150+ """
151+
143152 self .scissor : Rect | None = scissor
153+ """
154+ An optional rect which describes what pixels of the active render
155+ target should be drawn to when undefined the viewport rect is used.
156+ """
144157
145158 @classmethod
146159 def from_camera_data (
@@ -178,26 +191,28 @@ def from_camera_data(
178191 * - ``render_target``
179192 - Complex rendering setups
180193
181- :param camera_data: A :py:class:`~arcade.camera.data.CameraData`
182- describing the position, up, forward and zoom.
183- :param projection_data:
184- A :py:class:`~arcade.camera.data.OrthographicProjectionData`
185- which describes the left, right, top, bottom, far, near
186- planes and the viewport for an orthographic projection.
187- :param render_target: A non-screen
188- :py:class:`~arcade.gl.framebuffer.Framebuffer` for this
189- camera to draw into. When specified,
190-
191- * nothing will draw directly to the screen
192- * the buffer's internal viewport will be ignored
193-
194- :param viewport:
195- A viewport as a :py:class:`~arcade.types.rect.Rect`.
196- This overrides any viewport the ``render_target`` may have.
197- :param scissor:
198- The OpenGL scissor box to use when drawing.
199- :param window: The Arcade Window to bind the camera to.
200- Defaults to the currently active window.
194+ Args:
195+ camera_data:
196+ A :py:class:`~arcade.camera.data.CameraData`
197+ describing the position, up, forward and zoom.
198+ projection_data:
199+ A :py:class:`~arcade.camera.data.OrthographicProjectionData`
200+ which describes the left, right, top, bottom, far, near
201+ planes and the viewport for an orthographic projection.
202+ render_target:
203+ A non-screen :py:class:`~arcade.gl.framebuffer.Framebuffer` for this
204+ camera to draw into. When specified,
205+
206+ * nothing will draw directly to the screen
207+ * the buffer's internal viewport will be ignored
208+
209+ viewport:
210+ A viewport as a :py:class:`~arcade.types.rect.Rect`.
211+ This overrides any viewport the ``render_target`` may have.
212+ scissor:
213+ The OpenGL scissor box to use when drawing.
214+ window: The Arcade Window to bind the camera to.
215+ Defaults to the currently active window.
201216 """
202217
203218 if projection_data :
0 commit comments