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


Python Img.bcentre方法代码示例

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


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

示例1: die

# 需要导入模块: import Img [as 别名]
# 或者: from Img import bcentre [as 别名]
def die(screen):
    pygame.display.flip()
    pygame.time.wait(1000)
    screen.fill((0, 0, 0))
    Img.bcentre(Img.bfont, "FOOL", screen, col=(255, 255, 255))
    pygame.display.flip()
    pygame.time.wait(1000)
开发者ID:NoNotCar,项目名称:orbital,代码行数:9,代码来源:Coop.py

示例2: run

# 需要导入模块: import Img [as 别名]
# 或者: from Img import bcentre [as 别名]
 def run(self,screen,player):
     screen.fill((255,255,255))
     Img.bcentre(Img.bfont,"WIN",screen)
     pygame.display.flip()
     pygame.time.wait(1000)
     if not self.p:
         sys.exit()
开发者ID:Nouranium,项目名称:Monolith,代码行数:9,代码来源:GUI.py

示例3: Instruct

# 需要导入模块: import Img [as 别名]
# 或者: from Img import bcentre [as 别名]
def Instruct(instructions, time):
    words = instructions.split()
    text = ""
    for i in range(len(words)):
        pygame.event.pump()
        if i:
            text += " "
        text += words[i]
        screen.fill((255, 255, 255))
        Img.bcentre(Img.dfont, text, screen, col=(0, 0, 0))
        pygame.display.flip()
        pygame.time.wait(time)
开发者ID:NoNotCar,项目名称:orbital,代码行数:14,代码来源:multi.py

示例4: win

# 需要导入模块: import Img [as 别名]
# 或者: from Img import bcentre [as 别名]
 def win(self,screen):
     success.play()
     screen.fill((255,255,255))
     Img.bcentre(bfont,"YAY",screen)
     if self.score>self.hs:
         self.nhs=True
         Img.bcentre(tfont,"NEW HIGH SCORE: "+str(self.score),screen,100,(0,255,0))
     else:
         Img.bcentre(tfont,"SCORE: "+str(self.score),screen,100)
         Img.bcentre(tfont,"HIGH SCORE: "+str(self.hs),screen,200)
     pygame.display.flip()
     pygame.time.wait(2000)
     self.done="success"
开发者ID:NoNotCar,项目名称:OpenPipes,代码行数:15,代码来源:World.py

示例5: get_img

# 需要导入模块: import Img [as 别名]
# 或者: from Img import bcentre [as 别名]
 def get_img(self, world):
     screen = Img.blank32.copy()
     Img.bcentre(Img.sfont, str(self.rgb[0]), screen, -8, (self.rgb[0], 0, 0))
     Img.bcentre(Img.sfont, str(self.rgb[1]), screen, 1, (0, self.rgb[1], 0))
     Img.bcentre(Img.sfont, str(self.rgb[2]), screen, 10, (0, 0, self.rgb[2]))
     img = self.img.copy()
     img.blit(screen, (0, 0))
     return img
开发者ID:NoNotCar,项目名称:monolith,代码行数:10,代码来源:RGB.py

示例6: range

# 需要导入模块: import Img [as 别名]
# 或者: from Img import bcentre [as 别名]
expimg=Img.img2("Exp")
pexpimg=Img.img2("ExpPen")
bombimg=Img.img2("Bomb")
tickimg=Img.img2("Tick")
crossimg=Img.img2("Null")
pimgs=[Img.img2("men/"+x) for x in ["Man2","FMan","SMan","Tman"]]#+[Img.imgstrip("men/CMan")[0]]
breaking = False
Img.musplay("ChOrDs.ogg")
while not breaking:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            sys.exit()
        elif event.type == pygame.MOUSEBUTTONDOWN:
            breaking = True
    screen.fill((255, 0, 0))
    Img.bcentre(tfont,"BOMB BATTLES",screen)
    Img.bcentre(sfont,"Click to start",screen,50)
    pygame.display.flip()
    clock.tick(60)
breaking=False
controllers=[Controllers.Keyboard1(),Controllers.Keyboard2()]+[Controllers.UniJoyController(n) for n in range(pygame.joystick.get_count())]
activecons=[]
acps=[]
rsps=[]
rsc=[]
while not breaking:
    gevents=pygame.event.get()
    for event in gevents:
        if event.type == pygame.QUIT:
            sys.exit()
        elif event.type == pygame.MOUSEBUTTONDOWN and len(rsps)>1:
开发者ID:NoNotCar,项目名称:BombAdventures,代码行数:33,代码来源:battle.py

示例7: fail

# 需要导入模块: import Img [as 别名]
# 或者: from Img import bcentre [as 别名]
 def fail(self,screen):
     screen.fill((0,0,0))
     Img.bcentre(bfont,"FOOL",screen,col=(255,255,255))
     pygame.display.flip()
     pygame.time.wait(2000)
     self.done="fail"
开发者ID:NoNotCar,项目名称:OpenPipes,代码行数:8,代码来源:World.py

示例8: range

# 需要导入模块: import Img [as 别名]
# 或者: from Img import bcentre [as 别名]
             cont = False
         for gr, n in grects:
             if gr.collidepoint(mpos):
                 wgen = n
         for ws, n in wsrects:
             if ws.collidepoint(mpos):
                 wsizemod = n
         for ps, n in psrects:
             if ps.collidepoint(mpos):
                 pset = n
     elif ev.type == pygame.KEYDOWN:
         if ev.key == pygame.K_g and pygame.key.get_mods() & pygame.KMOD_LCTRL:
             godmode = True
 screen.fill(rgb)
 screen.blit(nland, (0, 0))
 Img.bcentre(Img.bfont, "MONOLITH", screen, -200)
 tutb = Img.fblit(screen, Img.dfont, "TUTORIAL", (255, 0, 0), (0, 0))
 grects = []
 wsrects = []
 if not puzzles:
     screen.blit(Img.dfont.render("GENERATOR:", True, (100, 100, 100)), (0, 480))
     screen.blit(Img.dfont.render("SIZE:", True, (100, 100, 100)), (490, 480))
     for n in range(len(Generators.gens)):
         grects.append((pygame.draw.rect(screen, (200, 200, 200) if n == wgen else (100, 100, 100),
                                         pygame.Rect(2 + n * 50, 512, 48, 48)), n))
     for n in range(3):
         wsrects.append((pygame.draw.rect(screen, (200, 200, 200) if n == wsizemod else (100, 100, 100),
                                          pygame.Rect(490 + n * 50, 512, 48, 48)), n))
 if puzzles:
     screen.blit(Img.dfont.render("PUZZLE SET:", True, (100, 100, 100)), (0, 480))
     for n in range(len(Generators.puzzles)):
开发者ID:NoNotCar,项目名称:monolith,代码行数:33,代码来源:monolith.py


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