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 developed our creative coding project in Chapter 9, Making Interactive Art with Creative Coding Techniques, and then programmed our small game in Chapter 10, Developing Web-Based Games, we did so by writing our JavaScript directly into the script editor of the Actions panel. For other projects that involve simple navigation and common commands, we can make use of 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...