質問編集履歴

3

書式の変更

2017/04/03 10:18

投稿

NaNoSa
NaNoSa

スコア31

test CHANGED
File without changes
test CHANGED
@@ -20,7 +20,7 @@
20
20
 
21
21
  HomeBackGround.position = CGPoint(x: self.frame.width/2, y: self.frame.height/2)
22
22
 
23
- self.addChild(#imageLiteral(resourceName: "HomeBackGround"))
23
+ self.addChild("HomeBackGround")
24
24
 
25
25
  }
26
26
 

2

書式の変更

2017/04/03 10:17

投稿

NaNoSa
NaNoSa

スコア31

test CHANGED
File without changes
test CHANGED
@@ -1 +1,35 @@
1
+ '''import SpriteKit
2
+
3
+
4
+
5
+ class GameScene: SKScene {
6
+
7
+
8
+
9
+
10
+
11
+ var HomeBackGround = SKSpriteNode()
12
+
13
+
14
+
15
+ override func didMove(to view: SKView) {
16
+
17
+
18
+
19
+ HomeBackGround = SKSpriteNode(imageNamed: "HomeBackGround")
20
+
21
+ HomeBackGround.position = CGPoint(x: self.frame.width/2, y: self.frame.height/2)
22
+
23
+ self.addChild(#imageLiteral(resourceName: "HomeBackGround"))
24
+
25
+ }
26
+
27
+
28
+
29
+
30
+
31
+ }'''
32
+
33
+
34
+
1
- xcodeで'self.addChild(HomeBackGround)'とするとその部分にcannot convert value of type 'UImage' to expected argument type 'SKNode' というエラーが起こってシミレーターがビルドできません。このエラーの解決策をご教授願います。
35
+ この中で'self.addChild(HomeBackGround)'とするとその部分にcannot convert value of type 'UImage' to expected argument type 'SKNode' というエラーが起こってシミレーターがビルドできません。このエラーの解決策をご教授願います。

1

書式の改善

2017/04/03 10:03

投稿

NaNoSa
NaNoSa

スコア31

test CHANGED
File without changes
test CHANGED
@@ -1 +1 @@
1
- xcodeで'''self.addChild(HomeBackGround)'''とするとその部分にcannot convert value of type 'UImage' to expected argument type 'SKNode' というエラーが起こってシミレーターがビルドできません。このエラーの解決策をご教授願います。
1
+ xcodeで'self.addChild(HomeBackGround)'とするとその部分にcannot convert value of type 'UImage' to expected argument type 'SKNode' というエラーが起こってシミレーターがビルドできません。このエラーの解決策をご教授願います。