ios - SKShapeNode 或其他东西上的 anchor

标签 ios sprite-kit skshapenode

我不知道如何在我的 SKShapeNode 中设置 anchor ,该 anchor 可能设置为 (0.5,0.0) 到 (0,0),因为当我的游戏绘制路径时,坐标系统无法正常工作......

感谢帮助

最佳答案

SKShapeNode 没有 anchor 。

LearnCocos2D 对这个问题的回答:

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).

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.

原始答案here .

关于ios - SKShapeNode 或其他东西上的 anchor ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23531126/

相关文章:

ios - 如何在 Objective-C 中使用多个参数调用 Swift 初始化方法

iphone 锁定时 IOS AIR 应用程序仍在运行?

ios - UICollectionViewController : Memory used increasing when scrolling

swift - 从场景中移除后如何停止 SKSpriteNode 的音频(Swift)?

swift - 在另一个中添加 SKShapeNode

ios - SKShapeNode 不绘制 UIBezierPath

iphone - 无法为版本化模型创建包文件夹?

ios - 边界碰撞检测

ios - 在 Swift 中从一个 SKScene 调用方法到另一个 SKScene 的最干净的方法是什么?

ios - 不能在 inout 函数中使用 SKShapeNode