當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。