Writing Code for Virtual Reality Interactions
As we've seen in previous chapters, there are several different approaches to writing code in Animate. When we programmed our small game in Chapter 11, Developing Web-Based Games, we did so by writing our JavaScript directly into the script editor of the Actions panel. For other projects, such as the clickable advertisement in Chapter 6, Interactive Motion Graphics for the Web, we used the Actions Wizard area to guide us.
Unlike coding within HTML5 Canvas documents, we cannot leverage CreateJS for our VR project. Even though all web-based document types in Animate use JavaScript as the programming language, the WebGL glTF and VR document types within Animate use a completely different library from what we've seen previously. This is a WebGL-based runtime library that Adobe has created specifically for these document types. Thankfully, though, the Actions Wizard area supports this runtime, so it is fairly easy to work with...