【发布时间】:2015-06-07 23:59:42
【问题描述】:
我正在尝试根据答案 here 和 this 获取子精灵在视图中的位置
for child in platformGroupNode.children {
CGPoint p = [child.superview convertPoint:child.center toNode:self.view ]
println(p)
}
但是我不确定如何将它与 SKSpriteNode Children 和 SKNode Parents 一起使用。
我也试过了,没有运气
for child in platformGroupNode.children {
var pos = child.position
var viewPos = convertPoint(pos, toNode: self.parent!)
if viewPos.x < 0 {
println("Out of screen")
}
}
【问题讨论】:
标签: swift sprite-kit skspritenode sknode