本文整理匯總了Python中polygon.Polygon.color方法的典型用法代碼示例。如果您正苦於以下問題:Python Polygon.color方法的具體用法?Python Polygon.color怎麽用?Python Polygon.color使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類polygon.Polygon
的用法示例。
在下文中一共展示了Polygon.color方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Polygon
# 需要導入模塊: from polygon import Polygon [as 別名]
# 或者: from polygon.Polygon import color [as 別名]
while True:
screen.blit(background, (0,0))
for event in pygame.event.get():
#EXIT EVENT
if event.type == QUIT:
pygame.quit()
sys.exit()
if event.type == MOUSEBUTTONDOWN:
shape.add_point(point=pygame.mouse.get_pos())
if event.type == KEYDOWN:
if event.key == K_SPACE:
shapes.append(shape)
shape = Polygon()
shape.color = (r(0, 255), r(0, 255), r(0, 255))
if event.key == K_RETURN:
pos = pygame.mouse.get_pos()
print "PIP: %r" % point_inside_polygon(pos[0], pos[1], shape)
#PASKAT KONTROLLIT
if event.key == K_RIGHT:
if x_speed==0:x_speed = start_speed
right_flag = True
if event.key == K_LEFT:
if x_speed==0:x_speed = start_speed*(-1)
left_flag = True
if event.key == K_DOWN:
if y_speed==0: y_speed = start_speed
down_flag = True