Writing Code for Virtual Reality Interactions
As we've seen in previous chapters, there are a number of different approaches to writing code in Animate. When we 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, such as the clickable advertisement in Chapter 6, Interactive Motion Graphics for the Web, we used the Actions Wizard to guide us.
Unlike coding within HTML5 Canvas documents, we cannot leverage CreateJS for our virtual reality 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 before. This is a WebGL-based runtime library that Adobe has created specifically for these document types. Thankfully though, the Actions Wizard supports this runtime, so it is fairly easy to work with...