2024-06-06 23:45:51 发布
网友
就像你从镜子里看它一样。不能只做texture_size(-100,50)例如,你会保持正直
texture_size(-100,50)
一种简单的方法是垂直翻转图像,然后旋转图像,使其产生与水平翻转相同的效果
python文件:
class MirrorCamera(Camera): def _camera_loaded(self, *largs): self.texture = self._camera.texture self.texture_size = list(self.texture.size) self.texture.flip_vertical()
kivy文件:
<MirrorCamera> canvas.before: PushMatrix Translate: xy: (self.x + self.width / 2, self.y + self.height / 2) Rotate: angle: 180 axis: (0, 0, 1.0) Translate: xy: (-self.x - self.width / 2, -self.y - self.height / 2) canvas.after: PopMatrix
一种简单的方法是垂直翻转图像,然后旋转图像,使其产生与水平翻转相同的效果
python文件:
kivy文件:
相关问题 更多 >
编程相关推荐