本文整理汇总了Python中Img.fblit方法的典型用法代码示例。如果您正苦于以下问题:Python Img.fblit方法的具体用法?Python Img.fblit怎么用?Python Img.fblit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Img
的用法示例。
在下文中一共展示了Img.fblit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: import Img [as 别名]
# 或者: from Img import fblit [as 别名]
def run(self, screen, player):
recrects = []
while True:
for e in pygame.event.get():
if e.type==pygame.QUIT:
sys.exit()
if e.type == pygame.MOUSEBUTTONDOWN:
mpos = pygame.mouse.get_pos()
for rr in recrects:
if rr[1].collidepoint(mpos):
self.cr.recipe = rr[0]
self.cr.recipeprogress = GameRegistry.craftrecipes[rr[0]][0][:]
elif e.type==pygame.KEYDOWN and e.key==pygame.K_LSHIFT:
return None
screen.fill((200, 200, 200))
recrects = []
Img.fblit(screen, Img.dfont, "CRAFTING: ", (0, 0, 0), (0, 0))
Img.fblit(screen,Img.sfont,", ".join(self.cr.recipeprogress),(0, 0, 0), (0, 32))
if self.cr.recipeprogress == GameRegistry.craftrecipes[self.cr.recipe][0]:
for n, r in enumerate(GameRegistry.craftrecipes):
recrects.append([n, screen.blit(r[2], (n * 32, 64))])
pygame.display.flip()
示例2: range
# 需要导入模块: import Img [as 别名]
# 或者: from Img import fblit [as 别名]
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)):
psrects.append((pygame.draw.rect(screen, (200, 200, 200) if n == pset else (100, 100, 100),