add finishButton to HUD
This commit is contained in:
parent
bddd226ffd
commit
99b57cc4cd
@ -51,6 +51,7 @@ class EntityManager {
|
||||
scene.addChild(hudEntitiy.atkSkill)
|
||||
scene.addChild(hudEntitiy.spySkill)
|
||||
scene.addChild(hudEntitiy.roundTimerLabel)
|
||||
scene.addChild(hudEntitiy.finishButton)
|
||||
}
|
||||
|
||||
if let spriteNode = entity.component(ofType: DefaultBaseComponent.self) {
|
||||
|
@ -27,14 +27,22 @@ class HUD: GKEntity {
|
||||
var roundTimerLabel: SKLabelNode
|
||||
let roundTimer: RoundTimer
|
||||
|
||||
var finishButton: ButtonNode
|
||||
|
||||
init(size: CGSize) {
|
||||
finishButton = ButtonNode(textureName: "yellow_button04", text: "Finish Round", isEnabled: true, position: CGPoint(x: EntityManager.gameEMInstance.scene.size.width * 0.15, y: EntityManager.gameEMInstance.scene.size.height * 0.1),
|
||||
onButtonPress: { print("Finish Round") }
|
||||
)
|
||||
finishButton.size = CGSize(width: 225, height: 40)
|
||||
finishButton.zPosition = 4
|
||||
|
||||
host = GameCenterManager.sharedInstance.hostingPlayer
|
||||
peer = GameCenterManager.sharedInstance.peerPlayer
|
||||
hostLabel = SKLabelNode(text: host?.displayName)
|
||||
hostUnitsLabel = SKLabelNode(text: "500" )
|
||||
peerLabel = SKLabelNode(text: peer?.displayName)
|
||||
peerUnitsLabel = SKLabelNode(text: "500")
|
||||
|
||||
|
||||
roundTimerLabel = SKLabelNode(text: "")
|
||||
roundTimerLabel.fontColor = UIColor.black
|
||||
roundTimerLabel.fontSize = CGFloat(45)
|
||||
|
Loading…
Reference in New Issue
Block a user