DisconnectBox Widget v7 - nodeGame/nodegame GitHub Wiki
- status : complete
- version : 7.x
Appearance of the DisconnectBox widget.
Offers features to handle disconnections and reconnections.
-
showDiscBtn: If TRUE, a button to disconnect is shown. Default: FALSE.
-
showStatus: If TRUE, the current status (connected/disconnected) is shown. Default: FALSE.
-
connectCb: A callback executed when a connection is detected.
-
disconnectCb: A callback executed when a disconnection is detected.
- leave: The text on the disconnect button.
- left: The text on the button after user has clicked it.
- disconnected: Message for status "disconnected."
- connected: Message for status "connected."
// Creates and appends a new DisconnectBox widget.
var root = document.body;
var disc = node.widgets.append('DisconnectBox', root, {
showDiscBtn: true,
disconnectCb: function() {
alert('Hey you disconnected!');
}
});