Actually I have asked this question before, but since I didn't know what I was talking about, I couldn't ask it properly. people tried to help me, but I was too lost to better explain. Now, at least I know what I'm looking for.
At the very bottom I have subclassed SKShapeNode, and I call it with the proper parameters:
And all is well. What I'd like to know is there a way that I can call the subclass with added parameters so that the subclass calls the default init with the value of RectOf, as it is doing now. And then uses the other parameters within the init?
At the very bottom I have subclassed SKShapeNode, and I call it with the proper parameters:
Code Block pegPlaceHolder = placeHolderRect(rectOf: CGSize(width: 100, 100 ))
And all is well. What I'd like to know is there a way that I can call the subclass with added parameters so that the subclass calls the default init with the value of RectOf, as it is doing now. And then uses the other parameters within the init?
Code Block class placeHolderRect : SKShapeNode { var height: CGFloat = 0.0 var width: CGFloat = 0.0 override init() { super.init() self.isHidden = true self.strokeColor = SKColor.green self.fillColor = SKColor.green self.zPosition = 0 } }