http://i58.tinypic.com/n1fbzc.jpg
但我希望它看起来像这样:
http://i62.tinypic.com/4zutfo.jpg
这里是代码,前两行是一件的例子, 其余的(“for”)用于绘制所有这些:
white_queen = pygame.image.load(os.path.join("images","wQn.png")).convert()
self.icons['wQ'] = pygame.transform.scale(white_queen, (self.square_size,self.square_size))
for r in range(boardSize):
for c in range(boardSize):
print "r is " + str(r) + ", and c is " + str(c)
(screenX,screenY) = self.ConvertToScreenCoords((r,c))
piece_name = board[r][c]
print "screen x is " + str(screenX) + ", and y is " + str(screenY)
print "name is " + piece_name
if piece_name != 'e':
self.screen.blit(self.icons[piece_name],(screenX,screenY), special_flags = BLEND_RGBA_MULT)
pygame.display.flip()
我想我在调用blit或调用另一个函数时缺少一些参数..
谢谢你的帮助。