My goal is to add a node which will have sizes equal to the sizes of the window in which the node is presenting.
When I'm trying this:
var screenSize: NSSize!
override func didMove(to view: SKView) {
screen = self.view?.frame.size
addCanvasNode()
}
fileprivate func addCanvasNode() {
canvasNode = SKShapeNode(rect: CGRect(x: -screen.width / 2, y: -screen.height / 2, width: screen.width, height: screen.height))
canvasNode.fillColor = .brown
addChild(canvasNode)
}
I get this look:
I do not get why I have those black borders around my node? Why the width and height of my node do not fit the window sizes? What I do wrong?