Adobe ATMOSPHERE BUILDER 1 Online Help Manual page 68

Table of Contents

Advertisement

64
Creating effects with JavaScript
Getting feedback about user position and orientation
The Actor module provides methods and properties for getting feedback about user
position and orientation. For example, you can write a script that executes an animation
when a user navigates to a given position in the world.
For example, the following code tests the player to see if it is within 10 world units of a
target vector. If so, it prints a message:
if (player.position.subtract(target.position).length < 10) {
chat.print("You are within ten feet of the target!");
}
For more information on the Actor module, see the Atmosphere JavaScript API documentation.
Printing in the chat window
The PrintDevice module provides methods and properties for printing text in the chat
area of the Atmosphere Browser. For example, you can write a script that prints "Hello"
when a user enters the world.
For more information on the PrintDevice module, see the Atmosphere JavaScript API
documentation.
Working with objects
The WorldObject module provides methods and properties for getting information about
objects in a world. The primary use of this module is to determine the location of objects
in a world. For example, if you want the computer to play a sound when the user enters a
room, you need to determine the location of the doorway. You can use the WorldObject
module to find the location of the doorway and then compare it to the user's position.
To receive notification when a user control-shift-clicks or mouses over a particular
object, use the onClick, onMouseOver, or onMouseOut callback in the
WorldObject module..
For example, the following code fills the vector position with the position of the world
object:
position = spiderWorldObject.position;
For more information on the WorldObject module, see the Atmosphere JavaScript API
documentation.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Atmosphere 1.0Atmosphere builder

Table of Contents