import Foundation
import SpriteKit
class MovingGround : SKSpriteNode {
let MovingGroundTexture = SKTexture(imageNamed: "MovingGround")
init(size: CGSize) {
super.init(texture: nil, color: nil, size:CGSizeMake(size.width, size.height))
anchorPoint = CGPointMake(0, 0)
position = CGPointMake(0.0, 0.0)
zPosition = 1
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
我一直在color: nil
收到错误,我该如何更改呢?
答案 0 :(得分:3)
正如错误消息所示,super.init(texture: nil, color: UIColor.whiteColor(), size:size)
不是一种颜色。如果您打算致电-- Foreign Key: "FK_Reviews_ReviewSetup_Id_ReviewSetups_Id"
-- ALTER TABLE "Reviews" DROP CONSTRAINT "FK_Reviews_ReviewSetup_Id_ReviewSetups_Id";
ALTER TABLE "Reviews"
ADD CONSTRAINT "FK_Reviews_ReviewSetup_Id_ReviewSetups_Id" FOREIGN KEY ("ReviewSetup_Id")
REFERENCES "ReviewSetups" ("Id") MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE;
,您必须提供实际颜色。我建议白色,这是默认值。
{{1}}