예제 #1
0
 def __init__(self, *args, **kwargs):
     PiCreature.__init__(self, *args, **kwargs)
     self.scale(self.scale_factor)
     self.shift(LEFT)
     self.to_edge(DOWN, buff = LARGE_BUFF)
     eyes = VGroup(self.eyes, self.pupils)
     eyes_bottom = eyes.get_bottom()
     eyes.scale(self.eye_scale_factor)
     eyes.move_to(eyes_bottom, aligned_edge = DOWN)
     looking_direction = self.get_looking_direction()
     for pupil in self.pupils:
         pupil.scale_in_place(self.pupil_scale_factor)
     self.look(looking_direction)
예제 #2
0
 def __init__(self, *args, **kwargs):
     PiCreature.__init__(self, *args, **kwargs)
     self.scale(self.scale_factor)
     self.shift(LEFT)
     self.to_edge(DOWN, buff=LARGE_BUFF)
     eyes = VGroup(self.eyes, self.pupils)
     eyes_bottom = eyes.get_bottom()
     eyes.scale(self.eye_scale_factor)
     eyes.move_to(eyes_bottom, aligned_edge=DOWN)
     looking_direction = self.get_looking_direction()
     for pupil in self.pupils:
         pupil.scale_in_place(self.pupil_scale_factor)
     self.look(looking_direction)
예제 #3
0
    def get_eyes(self, mode=None, thing_to_look_at=None):
        mode = mode or self.mode
        if thing_to_look_at is None:
            thing_to_look_at = self.thing_looked_at

        pi = Randolph(mode=mode)
        eyes = VGroup(pi.eyes, pi.pupils)
        pi.scale(self.height / eyes.get_height())
        if self.submobjects:
            eyes.move_to(self, DOWN)
        else:
            eyes.move_to(self.mobject.get_top(), DOWN)
        if thing_to_look_at is not None:
            pi.look_at(thing_to_look_at)
        return eyes
예제 #4
0
    def get_eyes(self, mode = None, thing_to_look_at = None):
        mode = mode or self.mode
        if thing_to_look_at is None:
            thing_to_look_at = self.thing_looked_at

        pi = Randolph(mode = mode)
        eyes = VGroup(pi.eyes, pi.pupils)
        eyes.scale_to_fit_height(self.height)
        if self.submobjects:
            eyes.move_to(self, DOWN)
        else:
            eyes.move_to(self.mobject.get_top(), DOWN)
        if thing_to_look_at is not None:
            pi.look_at(thing_to_look_at)
        return eyes