pygame を使用してディスプレイに描画した色を取得しようとしていますが、うまく動作しないようです。読みやすくするために無関係なコードをいくつか取り出しましたが、これが私が持っているものです。
import pygame
import sys
from pygame.locals import *
pygame.init()
blue = (0,0,255)
#sets up screen
setDisplay = pygame.display.set_mode((400,400))
pygame.display.set_caption('Connections')
pygame.draw.circle(setDisplay, blue, (20,20), 10, 10)
while True:
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
pygame.display.update()
print pygame.setDisplay.get_at((20,20))
このコードを実行すると、次のエラーが表示されます。
TypeError: descriptor 'get_at' requires a 'pygame.Surface' object but received a 'tuple'