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


Python ProgressBar.draw方法代码示例

本文整理汇总了Python中ProgressBar.ProgressBar.draw方法的典型用法代码示例。如果您正苦于以下问题:Python ProgressBar.draw方法的具体用法?Python ProgressBar.draw怎么用?Python ProgressBar.draw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProgressBar.ProgressBar的用法示例。


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

示例1: range

# 需要导入模块: from ProgressBar import ProgressBar [as 别名]
# 或者: from ProgressBar.ProgressBar import draw [as 别名]
    laserTimer += 1
    if laserTimer > 500 and laserCounter != 0:
        laserCounter -= 1
        laserTimer = 0

    ScoreTimer += 1
    if ScoreTimer > 50:
        Score += 1
        ScoreTimer = 0

    #draw lives and other player information bars
    for life in range(0, player.lives):
        windowSurface.blit(livesImage, [livesImage.get_height()*life, WINDOWHEIGHT - livesImage.get_height()])
        
    laserBar.update((30 - laserCounter)/30)
    laserBar.draw(windowSurface)
    
    shieldBar.update((player.shield.timeLimit - player.timer)/player.shield.timeLimit)
    shieldBar.draw(windowSurface)
        
    healthBar.update(player.lives / 3)
    healthBar.draw(windowSurface)

    head = pygame.font.Font(None, 20)
    text = head.render("Score: " + str(Score), True, [255,255,255])
    windowSurface.blit(text, [30, 50])

    # draw the window onto the screen
    pygame.display.update()
    mainClock.tick(40)
开发者ID:erhs-53-hackers,项目名称:Asteroid-Colliders,代码行数:32,代码来源:Main.py

示例2: ProgressBar

# 需要导入模块: from ProgressBar import ProgressBar [as 别名]
# 或者: from ProgressBar.ProgressBar import draw [as 别名]
                      # It is like if the Pyro daemon is not ready yet
                      # to handle many new client threads...
     thread.start_new_thread(worker_wrapper, (master, l))
 # feed workers
 if read_from_file:
     # read jobs from local file
     for cmd in commands_file:
         master.add_job(cmd)
         nb_jobs += 1
     master.add_job("END")
 if read_from_file:
     progress_bar = ProgressBar(0, nb_jobs)
     # output everything
     jobs_done = 0
     if show_progress:
         progress_bar.draw()
     while jobs_done < nb_jobs:
         cmd_and_output = results_queue.get()
         jobs_done += 1
         # FBR: more code factorization possible here
         #      if there is a default post_proc function which
         #      is the identity function
         if output_to_file:
             if has_post_proc_option:
                 output_file.write(post_proc_fun(cmd_and_output))
             else:
                 output_file.write(cmd_and_output)
         if show_progress:
             progress_bar.update(jobs_done)
             progress_bar.draw()
         elif not output_to_file:
开发者ID:UnixJunkie,项目名称:PAR,代码行数:33,代码来源:parallel.py


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