草庐IT

rectOfSize

全部标签

swift - 创建 SKShapeNode 的子类

classColorRectangle:SKShapeNode{varwidth:CGFloat!varheight:CGFloat!varrectColor:UIColor!convenienceinit(rectOfSize:CGSize,colorOfRectanglerectColor:UIColor){super.init(rectOfSize:rectOfSize)self.width=rectOfSize.widthself.height=rectOfSize.heightself.rectColor=rectColorself.fillColor=rectColorse

cocoa-touch - 使用 Swift 子类化 SKShapeNode

我正在尝试使用Swift对SKShapeNode进行子类化。到目前为止,我有这样的东西:importUIKitimportSpriteKitclassSTGridNode:SKShapeNode{init(){super.init()self.name="STGridNode"self.fillColor=UIColor(red:0.11,green:0.82,blue:0.69,alpha:1)}}在我的代码中,我希望按照以下方式做一些事情:lets=STGridNode(rectOfSize:CGSize(width:100,height:100))所以我的问题是-如何在STGri

cocoa-touch - 使用 Swift 子类化 SKShapeNode

我正在尝试使用Swift对SKShapeNode进行子类化。到目前为止,我有这样的东西:importUIKitimportSpriteKitclassSTGridNode:SKShapeNode{init(){super.init()self.name="STGridNode"self.fillColor=UIColor(red:0.11,green:0.82,blue:0.69,alpha:1)}}在我的代码中,我希望按照以下方式做一些事情:lets=STGridNode(rectOfSize:CGSize(width:100,height:100))所以我的问题是-如何在STGri