【发布时间】:2015-06-15 12:45:07
【问题描述】:
我想在另一个正方形中画一个正方形;但我不能以正确的方式定位第二个。 我可以根据第一个平方坐标进行定位吗?
var tileBackground = SKShapeNode(rectOfSize: CGSize(width: screenWidth, height: screenWidth))
tileBackground.name = "tileBackground"
tileBackground.fillColor = SKColor.whiteColor()
tileBackground.position = CGPoint(x: frame.midX, y: frame.midY);
self.addChild(tileBackground)
var tile = SKShapeNode(rectOfSize: CGSize(width: tileSize, height: tileSize))
tile.name = "tile1"
tile.fillColor = SKColor.redColor()
tile.position = CGPointMake(100,100)
tileBackground.addChild(tile)
【问题讨论】:
标签: swift sprite-kit skshapenode