cleaned Code
This commit is contained in:
parent
938c35196b
commit
7bebcf69df
@ -31,26 +31,6 @@ class CancelBtnNode: SKSpriteNode {
|
|||||||
super.init(texture: texture, color: SKColor.white, size: texture.size())
|
super.init(texture: texture, color: SKColor.white, size: texture.size())
|
||||||
self.size = CGSize(width: 30, height: 30)
|
self.size = CGSize(width: 30, height: 30)
|
||||||
self.position = position
|
self.position = position
|
||||||
|
|
||||||
let label = SKLabelNode(fontNamed: "Courier-Bold")
|
|
||||||
label.fontSize = 30
|
|
||||||
label.fontColor = SKColor.black
|
|
||||||
label.zPosition = 1
|
|
||||||
label.verticalAlignmentMode = .center
|
|
||||||
label.text = text
|
|
||||||
label.name = "label"
|
|
||||||
|
|
||||||
if iconName.isEmpty {
|
|
||||||
label.position = CGPoint(x: 0, y: 0)
|
|
||||||
} else {
|
|
||||||
label.position = CGPoint(x: size.width * 0.25, y: 0)
|
|
||||||
let icon = SKSpriteNode(imageNamed: iconName)
|
|
||||||
icon.position = CGPoint(x: -size.width * 0.25, y: 0)
|
|
||||||
icon.zPosition = 1
|
|
||||||
self.addChild(icon)
|
|
||||||
}
|
|
||||||
self.addChild(label)
|
|
||||||
|
|
||||||
isUserInteractionEnabled = true
|
isUserInteractionEnabled = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user