code of my pause menuHow can i integrate an admit interstitial Ad into swift 3. It is a virtual button. This is a what my pause screen looks like:import SpriteKit
let BUTTON_DISTANCE: CGFloat = 15 let BACKGROUND_COLOR = UIColor(red: 255, green: 255, blue: 255, alpha: 0.2)
class PauseMenu { let resumeButton: Button let resetButton: Button let menuButton: Button let root: SKNode = SKNode() let gameDelegate: GameDelegate let background: SKSpriteNode
init(scene: SKScene, delegate: GameDelegate) {
self.gameDelegate = delegate
root.position = CGPoint(x: scene.frame.midX, y: scene.frame.midY)
root.zPosition = 5
resumeButton = Button(scene: scene, parent: root, text: "Resume",
x: 0, y: DEFAULT_BUTTON_SIZE.height + BUTTON_DISTANCE,
action: gameDelegate.gameResumed)
resetButton = Button(scene: scene, parent: root, text: "Reset",
x: 0, y: 0, action: gameDelegate.gameReseted)
menuButton = Button(scene: scene, parent: root, text: "Menu",
x: 0, y: -(DEFAULT_BUTTON_SIZE.height + BUTTON_DISTANCE),
action: gameDelegate.returnMenu)
background = SKSpriteNode()
background.size = scene.size
background.position = CGPoint(x: 0, y: 0)
background.color = BACKGROUND_COLOR
root.addChild(background)
hide()
scene.addChild(root)
}
func touch(_ touch: UITouch) {
resumeButton.press(touch)
resetButton.press(touch)
menuButton.press(touch)
}
func release(_ touch: UITouch) {
resumeButton.release(touch)
resetButton.release(touch)
menuButton.release(touch)
}
func hide() {
root.isHidden = true
}
func show() {
root.isHidden = false
}
}
I want the ad to be displayed when you click the rest button. -Thx Zain