例如,我有两个SKLabelNode:" Easy"和"中等"
我将它们设置在相同的高度,但因为容易包含' y,因为他的尾巴它更高
如何将它们放在同一高度?
答案 0 :(得分:2)
您只需设置它们即可拥有相同的position.y
值
let easy = SKLabelNode(fontNamed:"Chalkduster")
easy.text = "Easy"
easy.fontSize = 45
easy.position = CGPoint(x:CGRectGetMidX(self.frame) - 200, y:CGRectGetMidY(self.frame))
self.addChild(easy)
let medium = SKLabelNode(fontNamed:"Chalkduster")
medium.text = "Medium"
medium.fontSize = 45
medium.position = CGPoint(x:CGRectGetMidX(self.frame) + 200, y:CGRectGetMidY(self.frame))
self.addChild(medium)