本文整理汇总了Python中Transform.skew_surface方法的典型用法代码示例。如果您正苦于以下问题:Python Transform.skew_surface方法的具体用法?Python Transform.skew_surface怎么用?Python Transform.skew_surface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transform
的用法示例。
在下文中一共展示了Transform.skew_surface方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: redraw
# 需要导入模块: import Transform [as 别名]
# 或者: from Transform import skew_surface [as 别名]
def redraw(self, rotation_x, rotation_y):
resize_width = 0
resize_height = 0
if (rotation_x + self.originalRotationX > 360):
resize_width = (rotation_x + self.originalRotationX * 1.0) % 90.0
resize_width = int(resize_width * 100)
Surface.__init__(self, self.get_size(), pygame.SRCALPHA)
Transform.skew_surface(self.originalImage, 0, -rotation_y), (0, 0)
self.blit(pygame.transform.scale(Transform.skew_surface(self.originalImage, 0, -rotation_y), (resize_width, self.get_size()[1])), (-rotation_x,0))
示例2: draw
# 需要导入模块: import Transform [as 别名]
# 或者: from Transform import skew_surface [as 别名]
def draw(self, surface):
self.fill((0,0,0))
self.cubeSide.update(self.rotation, 0)
self.cubeSide.redraw(self.rotation, 0)
print ("Equation = %s" % (-33 + int(((self.rotation * 1.0) % 90)/ 90.0 * 66)))
if self.rotation <= 90:
self.blit(pygame.transform.scale(Transform.skew_surface(self.originalImage, 0, -33 + int(((self.rotation * 1.0) % 90)) ), (int((self.rotation%90.0)/90*100), 100)), self.imageLocation)
else:
self.blit(pygame.transform.scale(Transform.skew_surface(self.originalImage, 0, -33 + int(((self.rotation * 1.0) % 90))),
(100 - int((self.rotation % 90.0) / 90 * 100), 100)), self.imageLocation)
if (self.rotation == 90):
self.rotation = 0
self.rotation += 1
self.imageLocation = (100 - int((self.rotation % 90.0) / 90 * 100), self.imageLocation[1])
surface.blit(self, (200, 200))
示例3: __init__
# 需要导入模块: import Transform [as 别名]
# 或者: from Transform import skew_surface [as 别名]
def __init__(self, size, images):
Surface.__init__(self, images[0].get_size(), pygame.SRCALPHA)
self.location = (0, 34)
self.blit(images[0], (0, 0))
self.xChange = 100
self.rotationX = 45
self.rotationY = 33
self.surfaces = [CubeSide(images[x], images[0].get_size(), x) for x in range(6)]
self.surfaces[0].blit(images[0], (0, 0))
self.surfaces[1].blit(images[1], (0, 0))
self.ORIGINAL_SURFACES = [pygame.Surface((100, 100), pygame.SRCALPHA) for _ in range(6)]
self.ORIGINAL_SURFACES[0].blit(images[0], (0, 0))
self.testingSurf = Transform.skew_surface(pygame.transform.scale(self.surfaces[0], (self.xChange, 100)), 0, 33)
self.testingSurf2 = Transform.skew_surface(pygame.transform.scale(self.surfaces[4], (self.xChange, 100)), 0, -33)