Fix size of menu scene text and logo
This commit is contained in:
parent
89dc64db27
commit
4a3d22596a
@ -9,29 +9,26 @@
|
||||
import Foundation
|
||||
import GameplayKit
|
||||
|
||||
class SpinningLogoEntity: GKEntity {
|
||||
class SpinningLogoEntity : GKEntity {
|
||||
|
||||
let spinningLogoNode : SpinningLogo3DNode
|
||||
let goldLetteringNode : SKSpriteNode
|
||||
let warsLetteringNode : SKSpriteNode
|
||||
let spinningLogoNode: SpinningLogo3DNode
|
||||
let goldLetteringNode: SKSpriteNode
|
||||
let warsLetteringNode: SKSpriteNode
|
||||
|
||||
init(sceneSize size: CGSize) {
|
||||
spinningLogoNode = SpinningLogo3DNode()
|
||||
let midX = size.width / 2
|
||||
let midY = size.height / 2
|
||||
goldLetteringNode = SKSpriteNode(texture: SKTexture(imageNamed: "goldLettering"))
|
||||
goldLetteringNode.position = CGPoint(x: midX, y: midY);
|
||||
goldLetteringNode.size = CGSize(width: 675, height: 284)
|
||||
goldLetteringNode.position = CGPoint(x: midX , y: midY + 280);
|
||||
goldLetteringNode.size = CGSize(width: 675, height: 284)
|
||||
goldLetteringNode.position = CGPoint(x: size.width / 2 , y: size.height * 0.83)
|
||||
goldLetteringNode.size = CGSize(width: size.width / 2.02, height: size.height / 3.6)
|
||||
|
||||
warsLetteringNode = SKSpriteNode(texture: SKTexture(imageNamed: "warsLettering"))
|
||||
warsLetteringNode.position = CGPoint(x: midX, y: midY - 300);
|
||||
warsLetteringNode.size = CGSize(width: 700, height: 284)
|
||||
warsLetteringNode.position = CGPoint(x: size.width / 2, y: size.height * 0.17)
|
||||
warsLetteringNode.size = CGSize(width: size.width / 2.02, height: size.height / 3.6)
|
||||
|
||||
spinningLogoNode.viewportSize = CGSize(width: 200, height: 200)
|
||||
spinningLogoNode = SpinningLogo3DNode()
|
||||
spinningLogoNode.viewportSize = CGSize(width: size.width / 5.12 * 0.69, height: size.height / 3.84 * 0.69)
|
||||
spinningLogoNode.zPosition = goldLetteringNode.zPosition - 1
|
||||
spinningLogoNode.position = CGPoint(x: midX - 65, y: midY + 285);
|
||||
spinningLogoNode.position = CGPoint(x: size.width * 0.455, y: size.height * 0.83)
|
||||
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
@ -17,50 +17,55 @@ class MenuScene: SKScene {
|
||||
entityManager.setScene(scene: self)
|
||||
let midX = self.size.width / 2
|
||||
let midY = self.size.height / 2
|
||||
entityManager.add(Button(name: "startGameButton",
|
||||
textureName: "gold_button_3",
|
||||
text: "Start Game",
|
||||
position: CGPoint(x: midX, y: midY + 90),
|
||||
onButtonPress: {
|
||||
if CommandLine.arguments.contains("--no-matchmaking") {
|
||||
self.loadScene(scene: GameScene(size: self.size))
|
||||
SoundManager.sharedInstance.stopMenuMusic()
|
||||
} else {
|
||||
|
||||
if GameCenterManager.isAuthenticated {
|
||||
GameCenterManager.sharedInstance.presentMatchmaker()
|
||||
}else {
|
||||
GameCenterManager.sharedInstance.authUser()
|
||||
}
|
||||
}
|
||||
}))
|
||||
entityManager.add(Button(name: "settingsButton",
|
||||
textureName: "gold_button_3",
|
||||
text: "Einstellungen",
|
||||
position: CGPoint(x: midX, y: midY ),
|
||||
onButtonPress: {
|
||||
let scene = SettingsScene(size: self.size)
|
||||
self.loadScene(scene: scene)
|
||||
}))
|
||||
entityManager.add(Button(name: "gameCenterButton",
|
||||
textureName: "gold_button_3",
|
||||
text: "GameCenter",
|
||||
position: CGPoint(x: midX, y: midY - 90),
|
||||
onButtonPress: {
|
||||
if GameCenterManager.isAuthenticated {
|
||||
GameCenterManager.sharedInstance.presentGameCenter()
|
||||
}else {
|
||||
GameCenterManager.sharedInstance.authUser()
|
||||
}
|
||||
}))
|
||||
entityManager.add(Button(name: "regelwerkButton",
|
||||
textureName: "questionmark",
|
||||
text: "",
|
||||
position: CGPoint(x: self.size.width - 50, y: self.size.height - 50),
|
||||
onButtonPress: {
|
||||
let scene = RulesScene(size: self.size)
|
||||
self.loadScene(scene: scene)
|
||||
}))
|
||||
entityManager.add(
|
||||
Button(name: "startGameButton",
|
||||
textureName: "gold_button_3",
|
||||
text: "Start Game",
|
||||
position: CGPoint(x: midX, y: midY + 90),
|
||||
onButtonPress: {
|
||||
if CommandLine.arguments.contains("--no-matchmaking") {
|
||||
self.loadScene(scene: GameScene(size: self.size))
|
||||
SoundManager.sharedInstance.stopMenuMusic()
|
||||
} else {
|
||||
if GameCenterManager.isAuthenticated {
|
||||
GameCenterManager.sharedInstance.presentMatchmaker()
|
||||
} else {
|
||||
GameCenterManager.sharedInstance.authUser()
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
)
|
||||
entityManager.add(
|
||||
Button(name: "settingsButton",
|
||||
textureName: "gold_button_3",
|
||||
text: "Einstellungen",
|
||||
position: CGPoint(x: midX, y: midY ),
|
||||
onButtonPress: { self.loadScene(scene: SettingsScene(size: self.size))}
|
||||
)
|
||||
)
|
||||
entityManager.add(
|
||||
Button(name: "gameCenterButton",
|
||||
textureName: "gold_button_3",
|
||||
text: "GameCenter",
|
||||
position: CGPoint(x: midX, y: midY - 90),
|
||||
onButtonPress: {
|
||||
if GameCenterManager.isAuthenticated {
|
||||
GameCenterManager.sharedInstance.presentGameCenter()
|
||||
} else {
|
||||
GameCenterManager.sharedInstance.authUser()
|
||||
}
|
||||
}
|
||||
)
|
||||
)
|
||||
entityManager.add(
|
||||
Button(name: "regelwerkButton",
|
||||
textureName: "questionmark",
|
||||
text: "",
|
||||
position: CGPoint(x: self.size.width - 50, y: self.size.height - 50),
|
||||
onButtonPress: { self.loadScene(scene: RulesScene(size: self.size)) }
|
||||
)
|
||||
)
|
||||
entityManager.add(Background(size: self.size))
|
||||
entityManager.add(SpinningLogoEntity(sceneSize: self.size))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user