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.atkSkill)
|
||||||
scene.addChild(hudEntitiy.spySkill)
|
scene.addChild(hudEntitiy.spySkill)
|
||||||
scene.addChild(hudEntitiy.roundTimerLabel)
|
scene.addChild(hudEntitiy.roundTimerLabel)
|
||||||
|
scene.addChild(hudEntitiy.finishButton)
|
||||||
}
|
}
|
||||||
|
|
||||||
if let spriteNode = entity.component(ofType: DefaultBaseComponent.self) {
|
if let spriteNode = entity.component(ofType: DefaultBaseComponent.self) {
|
||||||
|
@ -27,7 +27,15 @@ class HUD: GKEntity {
|
|||||||
var roundTimerLabel: SKLabelNode
|
var roundTimerLabel: SKLabelNode
|
||||||
let roundTimer: RoundTimer
|
let roundTimer: RoundTimer
|
||||||
|
|
||||||
|
var finishButton: ButtonNode
|
||||||
|
|
||||||
init(size: CGSize) {
|
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
|
host = GameCenterManager.sharedInstance.hostingPlayer
|
||||||
peer = GameCenterManager.sharedInstance.peerPlayer
|
peer = GameCenterManager.sharedInstance.peerPlayer
|
||||||
hostLabel = SKLabelNode(text: host?.displayName)
|
hostLabel = SKLabelNode(text: host?.displayName)
|
||||||
|
Loading…
Reference in New Issue
Block a user