当前位置: 首页>>代码示例>>Python>>正文


Python clock.unschedule函数代码示例

本文整理汇总了Python中pyglet.clock.unschedule函数的典型用法代码示例。如果您正苦于以下问题:Python unschedule函数的具体用法?Python unschedule怎么用?Python unschedule使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了unschedule函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: start

 def start(self):
     if self.__running:
         unschedule(self.update)
         self.__running = False
     else:
         schedule_interval(self.update, self.speed)
         self.__running = True
开发者ID:eordano,项目名称:random,代码行数:7,代码来源:conway.py

示例2: visible

 def visible(self, visible):
     self._visible = visible
     clock.unschedule(self._blink)
     if visible and self._active and self.PERIOD:
         clock.schedule_interval(self._blink, self.PERIOD)
         self._blink_visible = False  # flipped immediately by next blink
     self._blink(0)
开发者ID:bitcraft,项目名称:pyglet,代码行数:7,代码来源:caret.py

示例3: pause

 def pause(self):
     if not self.playing: return
     clock.unschedule(self.update)
     self.player.pause()
     self.control.play.setVisible(True)
     self.control.pause.setVisible(False)
     self.playing = False
开发者ID:DatRollingStone,项目名称:nwidget,代码行数:7,代码来源:movie.py

示例4: game_exit_callback

    def game_exit_callback(self, *args):
        if self._overlay:
            unschedule(self._overlay.update)
            self._overlay = None

        self.win.pop_handlers()
        self.win.close()
开发者ID:varnie,项目名称:snake,代码行数:7,代码来源:Game.py

示例5: leave

    def leave(self):
        # get the end time
        self.end_time = now()
        
        # update the parent state time to actual elapsed time if necessary
        if self.duration < 0:
            if isinstance(self, ParentState):
                # advance the duration the children moved the this parent
                duration = self.state_time-self.start_time
            else:
                # advance the duration of this state
                duration = self.end_time-self.start_time
            self.advance_parent_state_time(duration)

        # remove the callback from the schedule
        clock.unschedule(self.callback)

        # notify the parent that we're done
        self.active = False
        self.done = True
        if self.parent:
            self.parent.check = True

        # call custom leave code
        self._leave()

        # write log to the state log
        #print self.get_log()
        if self.save_log:
            dump([self.get_log()],self.get_log_stream())
        pass
开发者ID:psederberg,项目名称:smile,代码行数:31,代码来源:state.py

示例6: stopRepeat

 def stopRepeat(self):
     if self.delay_timer is not None:
         self.delay_timer.cancel()
         self.delay_timer = None
     if self.repeating:
         clock.unschedule(self.repeat)
     self.repeating = False
开发者ID:bitcraft,项目名称:pyglet,代码行数:7,代码来源:slider.py

示例7: village_scene

def village_scene(dt):
    clock.unschedule(spawn_troll)
    s.Narration("This time")
    s.Narration("They will say")
    s.Title("You are the Villain")
    clock.schedule_interval(village_callback, 5)
    for i in range(counter + 4):
        s.Villager(on_death = decrement_counter)
开发者ID:dragonfi,项目名称:ld25-you-are-the-hero,代码行数:8,代码来源:script.py

示例8: on_rerun_menu

        def on_rerun_menu():
            unschedule(func=self.update)

            #reset current handler
            self.win.pop_handlers()
            #and setup update handler
            self.win.push_handlers(self.menu)
            self.menu.start_bgrn_animation()
开发者ID:varnie,项目名称:snake,代码行数:8,代码来源:Game.py

示例9: _update_schedule

 def _update_schedule(self):
     clock.unschedule(self.dispatch_events)
     if self._playing and self._sources:
         interval = 1000.0
         if self._sources[0].video_format:
             interval = min(interval, 1 / 24.0)
         if self._audio:
             interval = min(interval, self._audio.UPDATE_PERIOD)
         clock.schedule_interval_soft(self.dispatch_events, interval)
开发者ID:tyler-elric,项目名称:pypk,代码行数:9,代码来源:__init__.py

示例10: in_transition

    def in_transition(self):
        for index, transition in enumerate(self.queue):
            if transition["phase"] == 0:
                del self.queue[index]

        if len(self.queue) <= 0:
            clock.unschedule(self.tick)

        return len(self.queue) > 0
开发者ID:Bogdanp,项目名称:ymage,代码行数:9,代码来源:transition.py

示例11: scene2

def scene2(dt):
    print "scene2"
    s.Narration('Why me?')
    s.Narration('Alone')
    s.Narration('Why me?')
    s.Narration('Alone')
    s.Narration('This is not fair')
    clock.unschedule(spawn_troll)
    clock.schedule_interval(spawn_troll, 3)
    clock.schedule_once(scene3, 20)
开发者ID:dragonfi,项目名称:ld25-you-are-the-hero,代码行数:10,代码来源:script.py

示例12: delete

    def delete(self):
        """Force immediate removal of the sprite from video memory.

        This is often necessary when using batches, as the Python garbage
        collector will not necessarily call the finalizer as soon as the
        sprite is garbage.
        """
        if self._animation:
            clock.unschedule(self._animate)
        self._vertex_list.delete()
        self._vertex_list = None
开发者ID:katalist5296,项目名称:irobotgame,代码行数:11,代码来源:sprite.py

示例13: test_unschedule

    def test_unschedule(self):
        clock.set_default(clock.Clock())
        clock.schedule(self.callback)

        result = clock.tick()
        self.assertTrue(result == self.callback_dt)
        self.callback_dt = None
        time.sleep(1)
        clock.unschedule(self.callback)

        result = clock.tick()
        self.assertTrue(self.callback_dt == None)
开发者ID:DatRollingStone,项目名称:nwidget,代码行数:12,代码来源:SCHEDULE.py

示例14: test_schedule_multiple

    def test_schedule_multiple(self):
        clock.set_default(clock.Clock())
        clock.schedule(self.callback)
        clock.schedule(self.callback)
        self.callback_count = 0

        clock.tick()
        self.assertTrue(self.callback_count == 2)
        clock.unschedule(self.callback)

        clock.tick()
        self.assertTrue(self.callback_count == 2)
开发者ID:DatRollingStone,项目名称:nwidget,代码行数:12,代码来源:SCHEDULE.py

示例15: update

    def update(self, dt):
        self._total_time += dt
        alpha = self._total_time / float(self._duration) 

        self._label.begin_update()
        self._label.x = alpha * (self._x1 - self._x0) + self._x0
        self._label.y = alpha * (self._y1 - self._y0) + self._y0
        self._label.font_size = alpha * (self._end_font_size - self._init_font_size) + self._init_font_size
        self._label.end_update()

        if self._total_time > self._duration:
            self.window.remove_handlers(self)
            clock.unschedule(self.update)
开发者ID:kearnh,项目名称:pqrs,代码行数:13,代码来源:objects.py


注:本文中的pyglet.clock.unschedule函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。