SKLabelNode 包含 (q,y,p,g or j) 时更高
SKLabelNode higher when it contains (q,y,p,g or j)
例如我有两个 SKLabelNode:"Easy" 和 "Medium"
我把它们设置在相同的高度但是因为easy包含一个'y',因为他的尾巴
所以它更高
如何将它们放在同一高度?
您只需设置它们即可获得相同的 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)
例如我有两个 SKLabelNode:"Easy" 和 "Medium"
我把它们设置在相同的高度但是因为easy包含一个'y',因为他的尾巴
所以它更高如何将它们放在同一高度?
您只需设置它们即可获得相同的 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)