Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Added example ShowScreenResolution (#678)

kolibril13c6e8578b7a10
diff --git a/docs/source/examples/shapes_images_positions.rst b/docs/source/examples/shapes_images_positions.rst
index 57f69f149..8888db588 100644
--- a/docs/source/examples/shapes_images_positions.rst
+++ b/docs/source/examples/shapes_images_positions.rst
@@ -1,5 +1,22 @@
Shapes, Images and Positions
=================================
+.. manim:: ShowScreenResolution
+ :save_last_frame:
+
+ class ShowScreenResolution(Scene):
+ def construct(self):
+ pixel_height = config["pixel_height"] # 1080 is default
+ pixel_width = config["pixel_width"] # 1920 is default
+ frame_width = config["frame_width"]
+ frame_height = config["frame_height"]
+ self.add(Dot())
+ d1 = Line(frame_width * LEFT / 2, frame_width * RIGHT / 2).to_edge(DOWN)
+ self.add(d1)
+ self.add(Tex(str(pixel_width)).next_to(d1, UP))
+ d2 = Line(frame_height * UP / 2, frame_height * DOWN / 2).to_edge(LEFT)
+ self.add(d2)
+ self.add(Tex(str(pixel_height)).next_to(d2, RIGHT))
+
.. manim:: GeometricShapes
:save_last_frame: