【发布时间】:2021-07-16 10:25:50
【问题描述】:
所以这里是pygame python代码的两部分:
a = self.img.get_rect(topleft = (self.x, self.y))
print(a.topleft)
这段代码的输出是:
(200, 189)
另一个pygame代码:
a = self.img.get_rect(topleft = (self.x, self.y)).center
print(a)
这段代码的输出:
(234, 213)
注意:The value of self.x is 200 and self.y is 200
所以现在我的问题是,在我们将 .center 放在 pygame rect object or the variable a 之后,当我打印 a 的值时它会发生什么变化以及 .center 在 pygame rect 对象之后有什么作用?
【问题讨论】:
标签: python python-3.x object pygame rect