赞
踩
rect = pygame.rect.Rect(0, 0, 100, 100)
pygame.draw.rect(screen, "#2b2b2b", rect, 1)
说明
pygame.draw.rect(屏幕,颜色,矩形对象,线条粗细)
线条粗细,如果是0就代表了是实心,如果是其它值代表了线条的粗细
示例
# 绘制血条上限 空心
test_rect = pygame.rect.Rect(0, 10, 100, 30)
pygame.draw.rect(screen, "#4298ff", test_rect, 2)
# 绘制当前血值 实心
test_rect_fill = pygame.rect.Rect(0, 10, 80, 30)
pygame.draw.rect(screen, "#4298ff", test_rect_fill, 0)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。