cvi的picture控件如何代码改变图片
1个回答
2016-01-08
展开全部
if energy_remain > 0.2: # 如果血量大约百分之二十则为绿色,否则为红色
energy_color = color_green
else:
energy_color = color_red
pygame.draw.line(screen, energy_color,
(each.rect.left, each.rect.top - 5),
(each.rect.left + each.rect.width * energy_remain, each.rect.top - 5),
2)
energy_color = color_green
else:
energy_color = color_red
pygame.draw.line(screen, energy_color,
(each.rect.left, each.rect.top - 5),
(each.rect.left + each.rect.width * energy_remain, each.rect.top - 5),
2)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询