SKShapeNode或其他上的锚点 [英] Anchorpoint on SKShapeNode or something else

查看:185
本文介绍了SKShapeNode或其他上的锚点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法弄清楚如何在我的SKShapeNode中将锚点设置为(0.5,0.0)到(0,0),因为当我的游戏绘制路径时,坐标系无法正常工作...

I can't figure out how to make the anchorpoint in my SKShapeNode that is probably set to (0.5,0.0) to (0,0) since when my game draws the path the coordinate system is not working right...

感谢您的帮助

推荐答案

SKShapeNode没有anchorPoint.

SKShapeNode does not have an anchorPoint.

LearnCocos2D对此问题进行了回答:

LearnCocos2D answered on this issue:

使用图像时,可能需要将其与节点的位置对齐.只能通过anchorPoint来执行此操作,因为图像本身无法修改(无论如何都不容易).

When you use an image you may need to align it on its node's position. There's no other way to do so but through anchorPoint because the image itself can't be modified (not easily anyway).

创建形状时,可以通过CGPath完全控制形状的对齐方式.您可以简单地平移路径以更改形状相对于节点位置的对齐方式.

When you create a shape you have full control over the alignment of the shape through CGPath. You can simply translate the path to change the shape's alignment relative to the node's position.

这是我的解释,不是事实.

This is my interpretation, not fact.

原始答案此处.

这篇关于SKShapeNode或其他上的锚点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆