The class MacaoPage is not a class itself, but it is used to document the global properties and methods of the package core/dynamic.js.
Method Summary | |
---|---|
number | calculateAngle(number dX1, number dY1, number dX2, number dY2)
This utility function calculates an angle between two vectors. |
number | calculateRandomDuration(number baseDuration)
This utility function calculates a random duration in milliseconds from a base duration. |
void | clearTalkedItems()
Call this method to end a talk. |
void | connectNodes(String node1Name, String node2Name, optional boolean alsoBack, optional boolean disconnect)
Use this method to connect or disconnect two named nodes. |
MacaoNet | createNet(String netType)
This method creates a net of the given name. |
MacaoNet | getNet(String netType)
Gets a net of a given name. |
MacaoNode | getNodeByName(String nodeName)
Use this method to get a node by its name. |
integer | getWalkInterval()
Call this method to get the duration between two steps of each walking object on the page in milliseconds. |
boolean | isArrayElement(Array array, variant element, optional integer arrayLength)
This utility function checks, if the provided element is one of the elements of the array. |
variant | selectRandomElement(Array array)
This utility function selects a random item from an array. |
void | setWalkInterval(integer walkInterval)
Call this method to change the duration between two steps of each walking object on the page. |
Method Details |
---|
This utility function calculates an angle between two vectors.
This utility function calculates a random duration in milliseconds from a base duration.
The function uses an exponential spreading of the return values, because it's more natural. This means, that short durations are more often than long durations. The base duration defines a value of a more short duration. The durations returned are between 0.37 x baseDuration and 5.47 x baseDuration.
Call this method to end a talk.
It removes all names from the list of talked items. This lets talk items with the property onceAtTalk reappear. See also MacaoTalkItem(). and MacaoTalkItem.setClearTalk().
Use this method to connect or disconnect two named nodes.
The nodes must be named to be used by this method. See also MacaoNode.setName(). If the nodes are not found by their names, they will not be connected.
This method creates a net of the given name.
See also getNet().
Gets a net of a given name.
See also createNet().
Use this method to get a node by its name.
See also MacaoNode.setName().
Call this method to get the duration between two steps of each walking object on the page in milliseconds.
See also setWalkInterval().
This utility function checks, if the provided element is one of the elements of the array.
This utility function selects a random item from an array.
Call this method to change the duration between two steps of each walking object on the page.
The real duration between two steps is the walk interval you set by this function plus the time it needs to calculate and
display the step. The time may be further extended, if many objects are to be moved on the page. If you set this value too
small, the page may unexpectedly speed up on faster computers in the future. If you set this value too large, the walking
of the objects appears more bucking.
The default value is set to 150.
See also getWalkInterval().