import manimlib as mnm
class Manimala(mnm.Scene):
def construct(self):
text = mnm.Text('ขยาย',color='#EE7733')
self.play(
text.animate.scale(7),
run_time=1.5
)
import manimlib as mnm
class Manimala(mnm.Scene):
def construct(self):
text = mnm.Text('ย่อส่วน',color='#bbff33')
text.scale(8) # ขยายออกไปก่อน
self.play(
text.animate.scale(0.2),
run_time=1.5
)
import manimlib as mnm
class Manimala(mnm.Scene):
def construct(self):
text1 = mnm.Text('สูงขึ้น',color='#bb33dd')
text2 = mnm.Text('กว้างขึ้น',color='#77bbdd')
self.play(
text1.animate.stretch(6,1),
text2.animate.stretch(5,0),
run_time=1.5
)
import manimlib as mnm
class Manimala(mnm.Scene):
def construct(self):
text1 = mnm.Text('แคบลง',color='#efa3b7')
text2 = mnm.Text('เตี้ยลง',color='#daefa3',size=5)
text1.stretch(6,0)
self.play(
text1.animate.stretch(0.1,0),
text2.animate.stretch(0.2,1),
run_time=1.5
)
import manimlib as mnm
import numpy as np
class Manimala(mnm.Scene):
def construct(self):
text1 = mnm.Text('ขยายไปทางขวาล่าง',color='#d3a3ef')
text2 = mnm.Text('ยืดไปทางซ้าย',color='#efd3a3')
point1 = np.array([-3,1.5,0])
point2 = np.array([2,0,0])
self.play(
text1.animate.scale(2,about_point=point1),
text2.animate.stretch(3,0,about_point=point2),
run_time=1.5
)
import manimlib as mnm
import numpy as np
class Manimala(mnm.Scene):
def construct(self):
text = mnm.Text('ขยายแล้วก็ย่อ',color='#ddffaa')
point = np.array([0,-4,0])
self.play(
text.animate.set_width(12),
run_time=1
)
self.play(
text.animate.set_height(1,about_point=point),
run_time=1.5
)
import manimlib as mnm
class Manimala(mnm.Scene):
def construct(self):
text1 = mnm.Text('ปรับความกว้าง',color='#d3e3fa')
text2 = mnm.Text('ปรับความสูง',color='#bffaa3')
self.play(
text1.animate.set_width(10,stretch=True),
text2.animate.set_height(7,stretch=True),
run_time=1.5
)
import manimlib as mnm
class Manimala(mnm.Scene):
def construct(self):
text1 = mnm.Text('ปรับความกว้าง',color='#d3e3fa')
text2 = mnm.Text('ปรับความสูง',color='#bffaa3')
self.play(
text1.animate.stretch_to_fit_width(10),
text2.animate.stretch_to_fit_height(7),
run_time=1.5
)
import manimlib as mnm
class Manimala(mnm.Scene):
def construct(self):
text1 = mnm.Text('พลิกแนวนอน',color='#d3e3fa',size=3)
text2 = mnm.Text('พลิกแนวตั้ง',color='#bffaa3',size=3)
self.play(
text1.animate.stretch(-1,0),
text2.animate.stretch(-1,1),
run_time=1.5
)
import manimlib as mnm
class Manimala(mnm.Scene):
def construct(self):
text = mnm.Text('พลิกไม่ใช่พริก',color='#efa3eb',size=3)
self.play(
text.animate.scale(-1),
run_time=2
)
ติดตามอัปเดตของบล็อกได้ที่แฟนเพจ