本文整理汇总了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)
示例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()
示例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)
示例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"
示例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
示例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:
示例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"
示例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)):