简体   繁体   English

在Pygame中记录坐标

[英]Recording Coordinates in Pygame

I'm using pygame and am wondering this: You push button X to blit an image onto the surface at (x,y). 我正在使用pygame,并对此感到疑惑:您按下按钮X即可在(x,y)的表面上绘制图像。 You then move your selector to a new coordinate (xnew, ynew) and hit button X to blit another image at (xnew, ynew) How can I save each coordinate that an image is blitted at for later reference? 然后,将选择器移动到新坐标(xnew,ynew)并按按钮X,在(xnew,ynew)处放大另一个图像。我如何保存对图像进行漂白的每个坐标,以供以后参考?

Just... add them to a list? 只是...将它们添加到列表中?

blit_spots = []

# ...later on...
blit_spots.append((x, y))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM