我在sprite kit中创建了这个游戏,并在GameViewController中添加了一个横幅。当横幅出现时,尽管整个SKScene菜单向上移动了一点,而不是在加载时横过场景的横幅。这是我的代码。
我怎样才能让场景根本不动?
class GameViewController: UIViewController, ADBannerViewDelegate, ADInterstitialAdDelegate {
override func viewDidLoad() {
super.viewDidLoad()
// Presenting scene without using GameScene.sks
let skView = self.view as SKView
let myScene = Menu(size: skView.frame.size)
skView.presentScene(myScene)
//loadInterstitialAd()
self.canDisplayBannerAds = true
self.bannerView?.delegate = self
self.bannerView?.hidden = true
}
func bannerViewDidLoadAd(banner: ADBannerView!) {
self.bannerView?.hidden = false
view.hidden = true
}
func bannerViewActionShouldBegin(banner: ADBannerView!, willLeaveApplication willLeave: Bool) -> Bool {
return willLeave
}
func bannerView(banner: ADBannerView!, didFailToReceiveAdWithError error: NSError!) {
self.bannerView?.hidden = true
view.hidden = false
}