Background add
This commit is contained in:
parent
63e0336413
commit
dffcb320b2
BIN
GoldWars/GoldWars/Assets.xcassets/Background.imageset/Backgorund.png
vendored
Normal file
BIN
GoldWars/GoldWars/Assets.xcassets/Background.imageset/Backgorund.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 149 KiB |
BIN
GoldWars/GoldWars/Assets.xcassets/Background.imageset/Background@2x.png
vendored
Normal file
BIN
GoldWars/GoldWars/Assets.xcassets/Background.imageset/Background@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 423 KiB |
BIN
GoldWars/GoldWars/Assets.xcassets/Background.imageset/Background@3x.png
vendored
Normal file
BIN
GoldWars/GoldWars/Assets.xcassets/Background.imageset/Background@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 849 KiB |
23
GoldWars/GoldWars/Assets.xcassets/Background.imageset/Contents.json
vendored
Normal file
23
GoldWars/GoldWars/Assets.xcassets/Background.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "Backgorund.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "Background@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "Background@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
@ -36,6 +36,14 @@ class GameScene: SKScene {
|
||||
}
|
||||
|
||||
}
|
||||
override func didMove(to view: SKView) {
|
||||
let background = SKSpriteNode(imageNamed: "Background")
|
||||
background.position = CGPoint(x: self.size.width / 2, y: self.size.height / 2)
|
||||
background.zPosition = -1
|
||||
background.size = self.size
|
||||
self.addChild(background)
|
||||
}
|
||||
|
||||
|
||||
func touchDown(atPoint pos : CGPoint) {
|
||||
|
||||
|
@ -38,8 +38,6 @@
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
|
Loading…
Reference in New Issue
Block a user