April 2021
Beginner to intermediate
506 pages
11h 57m
English
AVFoundation is a powerful audiovisual framework for iOS, macOS, watchOS, and tvOS. With AVFoundation, you can add powerful media features to your games. In a SpriteKit scene, you have access to its audioEngine property; however, before you can use this property, you first need to import the AVFoundation framework.
Open the GameScene.swift file, and import the AVFoundation framework by adding the following line of code above the line that reads import SpriteKit:
| | import AVFoundation |
With that import statement, you now have access to the mainMixerNode properties of the audioEngine attached to the scene.
To achieve the desired fade-in effect, you’ll use the outputVolume property on the mainMixerNode to decrease ...
Read now
Unlock full access