Swift Playgrounds错误

时间:2016-06-20 06:06:22

标签: ios swift sprite-kit swift-playground

我已经得到了很多错误,无论我是在一个快速的游戏场地,还是Xcode项目:“:调用-display没有效果。”还有其他人得到这个问题吗?有没有人能够纠正它?我使用的是7.3.1版本。我试图在屏幕上创建形状来练习物理用法。继承我的代码:

import SpriteKit
import UIKit
import XCPlayground

let sceneView = SKView(frame: CGRect(x: 0, y: 0, width: 480, height:320))
let scene = SKScene(size: CGSize(width: 480, height: 320))
sceneView.showsFPS = true
sceneView.presentScene(scene)
XCPlaygroundPage.currentPage.needsIndefiniteExecution = true
XCPlaygroundPage.currentPage.liveView = sceneView

let square = SKSpriteNode(imageNamed: "square")
square.name = "shape"
square.position = CGPoint(x: scene.size.width * 0.25, y: scene.size.height * 0.50)

let circle = SKSpriteNode(imageNamed: "circle")
circle.name = "shape"
circle.position = CGPoint(x: scene.size.width * 0.50, y: scene.size.height * 0.50)

let triangle = SKSpriteNode(imageNamed: "triangle")
triangle.name = "shape"
triangle.position = CGPoint(x: scene.size.width * 0.75, y: scene.size.height * 0.50)

scene.addChild(square)
scene.addChild(circle)
scene.addChild(triangle)

0 个答案:

没有答案