複数Textの左詰め配置

Manim CEにおいて、複数Textを左詰めに配置するには、複数のテキストを、GroupVGroup格納し、arrange関数のaligned_edgeleftを指定します。

以下は、例です。

Everything is expanded.Everything is shortened.
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
from manim import *
 
class AlignedEdgeExample(Scene):
 
    def construct(self):
 
        unsat_graph_text = Text('Groundwater Flow Analysis Solving Steps', font_size=46, color=GREEN_A).to_edge(UP)
        hp_text = Text('1. Known Pressure Head', font_size=36)
        sp_text = Text('2. Find specific water capacity', font_size=36)
        th_text = Text('3. Find the volumetric moisture content', font_size=36)
        kr_text = Text('4. Find the specific permeability', font_size=36)
        solve_text = Text('5. Solve for pressure head from basic equations', font_size=36)
        text_grp = Group(unsat_graph_text,hp_text,sp_text,th_text,kr_text,solve_text)
 
        text_grp.arrange(DOWN, center=False, aligned_edge=LEFT, buff=0.4)
 
        self.add(text_grp)

作成された図は以下の通りです。

 AlignedEdgeExample

添付ファイル: fileAlignedEdgeExample.png 189件 [詳細]

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2024-05-30 (木) 14:38:52 (536d)