The class MacaoBubble is used to display bubbles for objects as popups. When loading the package core/kernel.js into a page, there is automatically created one invisible object of the class MacaoBubble. This bubble has the object name "Bubble".
When you let an object say something by calling the method say() or by using the talk funcitonality (see addTalkItem()), the bubble is moved to the object and is made visible, showing the text, image or html. When the bubble is already saying something for another object, the content will be buffered as a MacaoBubbleItem. After the previous contents are displayed, the new buffered content will be displayed.
The one MacaoBubble is also be used to show popus (see showPopup()). Popups are buffered like other bubbles. The only difference is, that a popup is positioned in the centre of the visible
client area of the frame.
The duration of the display of a bubble can be provided when opening the bubble. Or it can be calculated automatically by
the length of the text, which is to be displayed. You can call setSpeedFactor() to modify the factor between text length and duration. You can also let the bubble stay open, until you send it a clear() event.
See also say(), addTalkItem(), showPopup().
Constructor Summary |
---|
MacaoBubble(String name)
The class MacaoBubble is used to display bubbles for objects as popups. When loading the package core/kernel.js into a page, there is automatically created one invisible object of the class MacaoBubble. This bubble has the object name "Bubble". |
Method Summary | |
---|---|
void | clear()
Call this method to end the display of the current message and start the display of the next message. |
void | display(String targetObjectName, String text, optional String html, optional String imageSource, optional integer imageWidth, optional integer imageHeight, optional integer duration, optional String afterEventType, optional Array afterEventParams, optional String cssClassName, optional String lookName)
Call this method to initiate the display of a message or image by the bubble. |
number | getSpeedFactor()
Use this method to get the current factor, which is used to calculate the display duration from the text length. |
void | setSpeedFactor(number speedFactor)
Use this method to change the factor, which is used to calculate the display duration by the length of the text. |
Constructor Details |
---|
The class MacaoBubble is used to display bubbles for objects as popups. When loading the package core/kernel.js into a page, there is automatically created one invisible object of the class MacaoBubble. This bubble has the object name "Bubble".
You may use this class to create additional bubble items. But normally it's enough to have one bubble item, because the user can only read one bubble at a time.
Method Details |
---|
Call this method to end the display of the current message and start the display of the next message.
If there are no more bubble items in the queue, the bubble will be hidden.
Call this method to initiate the display of a message or image by the bubble.
If the bubble is already displaying a message, the message will be queued as a MacaoBubbleItem object. When the display of one message is cleared (see clear()), the next message of the queue will be displayed. After the last message of the queue the bubble will be hidden.
See also say(), showPopup().
Use this method to get the current factor, which is used to calculate the display duration from the text length.
See also setSpeedFactor().
Use this method to change the factor, which is used to calculate the display duration by the length of the text.
The default value is 100. The display duration in milliseconds is calculated by the following formula: (6 + characters) *
speedFactor
Because all objects on a page share the same bubble named "Bubble", you can change the factor by sending an event to the Bubble
object.