Skip to main content

To Edge

Description

The to_edge function moves a mobject to a specified edge of the canvas with an optional buffer.

Parameters

  • edge (Vector3, default=LEFT): The edge of the canvas to move the mobject to. Must be one of UP, DOWN, LEFT, RIGHT.
  • buff (float, default=DEFAULT_MOBJECT_TO_EDGE_BUFFER): The buffer distance between the mobject and the edge.

Examples

Example 1

Move a text mobject to the top canvas edge (like a title).

from smanim import *

title = Text("Title",font_size=H1_FONT_SIZE)
title.to_edge(UP)

canvas.add(title)
canvas.draw()
Example 1