clippyjs
clippyjs copied to clipboard
Agent Stops Functioning After Speaking Is Set To Stay Open After Display
To make an agent's text bubble appear, the speak
method can be invoked with the message as the first parameter, "text
":
window.addEventListener('load', () => {
clippy.load('F1', clippyAgent => {
clippyAgent.show();
clippyAgent.speak('Hi!');
});
});
However, the text quickly vanishes. In order to get it to stay on the screen, a second parameter, "hold
", must be passed with the value of true
:
window.addEventListener('load', () => {
clippy.load('F1', clippyAgent => {
clippyAgent.show();
clippyAgent.speak('Hi!', true);
});
});
Once the agent has finished its text, it does not hold, and stops animating and functioning altogether.
Executing a moveTo
call prior to the speak
seems to make the text hold, but again the functionality/animation breaks and the text cannot disappear:
window.addEventListener('load', () => {
clippy.load('F1', clippyAgent => {
clippyAgent.show();
clippyAgent.moveTo(200, 200);
clippyAgent.speak('Hi!', true);
setTimeout(() => clippyAgent.closeBalloon(), 10000);
});
});
Requesting that the text is closed via closeBalloon
will eventually hide the message, but the functionality of the agent remains broken. It can be dragged around, but it does not animate any further:
window.addEventListener('load', () => {
clippy.load('F1', clippyAgent => {
clippyAgent.show();
clippyAgent.moveTo(200, 200);
clippyAgent.speak('Hi!', true);
setTimeout(() => clippyAgent.closeBalloon(), 10000);
});
});