Exemple #1
0
 def update(self, dt=0, recursive=True):
     if not self.updating_suspended:
         for updater in self.updaters:
             parameters = get_parameters(updater)
             if "dt" in parameters:
                 updater(self, dt)
             else:
                 updater(self)
     if recursive:
         for submob in self.submobjects:
             submob.update(dt, recursive)
     return self
Exemple #2
0
 def update(self, dt=0, recursive=True):
     if self.updating_suspended:
         return self
     for updater in self.updaters:
         parameters = get_parameters(updater)
         if "dt" in parameters:
             updater(self, dt)
         else:
             updater(self)
     if recursive:
         for submob in self.submobjects:
             submob.update(dt, recursive)
     return self
    def add_updater(self, update_function, index=None, call_updater=True):
        if "dt" in get_parameters(update_function):
            updater_list = self.time_based_updaters
        else:
            updater_list = self.non_time_updaters

        if index is None:
            updater_list.append(update_function)
        else:
            updater_list.insert(index, update_function)

        if call_updater:
            self.update(0)
        return self
Exemple #4
0
 def has_time_based_updater(self):
     for updater in self.updaters:
         if "dt" in get_parameters(updater):
             return True
     return False
Exemple #5
0
 def get_time_based_updaters(self):
     return [
         updater for updater in self.updaters
         if "dt" in get_parameters(updater)
     ]
Exemple #6
0
 def has_time_based_updater(self):
     for updater in self.updaters:
         if "dt" in get_parameters(updater):
             return True
     return False
Exemple #7
0
 def get_time_based_updaters(self):
     return [
         updater for updater in self.updaters
         if "dt" in get_parameters(updater)
     ]