iOS Sprite Kit如何水平反映精灵? [英] iOS Sprite Kit how to reflect a sprite horizontally?
本文介绍了iOS Sprite Kit如何水平反映精灵?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法创建一个SKSpriteNode并传递一个图像名称,但它是否水平反映了图像?
Is there a way to create a SKSpriteNode and pass it an image name, but have it reflect the image horizontally?
推荐答案
您的意思是想要翻转图像?
You mean you want to flip the image?
node.xScale = node.xScale * -1;
或
node.yScale = node.yScale * -1;
这篇关于iOS Sprite Kit如何水平反映精灵?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文