本文整理汇总了Python中Physics.to_pygame方法的典型用法代码示例。如果您正苦于以下问题:Python Physics.to_pygame方法的具体用法?Python Physics.to_pygame怎么用?Python Physics.to_pygame使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Physics
的用法示例。
在下文中一共展示了Physics.to_pygame方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: draw
# 需要导入模块: import Physics [as 别名]
# 或者: from Physics import to_pygame [as 别名]
def draw(self, screen):
#~ pos = Physics.to_pygame(self.body.position)
#~ screen.blit(self.image, (pos[0], pos[1]-self.height)) # Draw at bottom left
self.v1 = Physics.to_pygame(Vec2d(self.p1[0], self.p1[1]))
self.v2 = Physics.to_pygame(Vec2d(self.p2[0], self.p2[1]))
pygame.draw.line(screen, self.color, self.v1, self.v2, 20)
示例2: draw
# 需要导入模块: import Physics [as 别名]
# 或者: from Physics import to_pygame [as 别名]
def draw(self, screen):
pos = Physics.to_pygame(self.body.position)
#~ screen.blit(self.image, (pos[0], pos[1]-Physics.to_px(self.height)))
#~ pos = self.body.position
screen.blit(self.image, (pos[0], pos[1]-self.height))
示例3: draw
# 需要导入模块: import Physics [as 别名]
# 或者: from Physics import to_pygame [as 别名]
def draw(self, screen):
if(self.visible == True):
#~ super(Powerup, self).draw(screen)
pos = Physics.to_pygame(self.body.position)
screen.blit(self.image, (pos[0], pos[1]-self.height))
示例4: draw
# 需要导入模块: import Physics [as 别名]
# 或者: from Physics import to_pygame [as 别名]
def draw(self, screen):
pos = Physics.to_pygame(self.body.position)
#~ pos = self.body.position
screen.blit(self.image, (pos[0]-self._animation.get_width()/2,
pos[1]-self._animation.get_height()))
示例5: draw
# 需要导入模块: import Physics [as 别名]
# 或者: from Physics import to_pygame [as 别名]
def draw(self, surface):
surface.blit(self.image, Physics.to_pygame(self.body.position))