Methods
(static) cancelVirtualKeyboard() → {DewPromise}
(ASYNCHRONOUS) Requests to cancel the currently-active virtual keyboard.
Returns:
A promise that will be resolved once the keyboard is cancelled.
- Type
- DewPromise
(static) captureInput(capture)
Requests to change this screen's input capture state.
Parameters:
| Name | Type | Description |
|---|---|---|
capture |
boolean | true to capture mouse and keyboard input, false to release. |
(static) capturePointer(capture)
Requests to change this screen's pointer capture state. This is overridden by dew.captureInput
Parameters:
| Name | Type | Description |
|---|---|---|
capture |
boolean | true to only capture mouse input, false to release. |
(static) command(command, optionsopt) → {DewPromise.<string>}
(ASYNCHRONOUS) Runs a console command.
If the command does not run successfully, the promise will be rejected with a DewErrorCode.COMMAND_FAILED error. The error message will be the command output.
Parameters:
| Name | Type | Attributes | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
command |
string | The command and its arguments, separated by spaces. |
|||||||||||
options |
object |
<optional> |
Additional options that control how the command should run. Properties
|
Returns:
A promise for the command output.
- Type
- DewPromise.<string>
(static) gameaction(actionIndex)
(ASYNCHRONOUS) Queues a game action to be pressed in-game
Parameters:
| Name | Type | Description |
|---|---|---|
actionIndex |
integer | The index of the game action to be pressed. |
(static) getCommands() → {DewPromise.<Array.<ConsoleCommand>>}
(ASYNCHRONOUS) Gets a list of available console commands.
Returns:
A promise for the list of available console commands.
- Type
- DewPromise.<Array.<ConsoleCommand>>
(static) getGameVariantInfo() → {DewPromise.<GameVariantInfo>}
(ASYNCHRONOUS) Gets info about the current game variant.
If game variant info is not available, the promise will be rejected with a DewErrorCode.NOT_AVAILABLE error.
Returns:
A promise for the game variant info.
- Type
- DewPromise.<GameVariantInfo>
(static) getMapVariantInfo() → {DewPromise.<MapVariantInfo>}
(ASYNCHRONOUS) Gets info about the current map variant.
If map variant info is not available, the promise will be rejected with a DewErrorCode.NOT_AVAILABLE error.
Returns:
A promise for the map variant info.
- Type
- DewPromise.<MapVariantInfo>
(static) getScoreboard() → {DewPromise.<ScoreboardInfo>}
(ASYNCHRONOUS) Gets information about the current game's scoreboard.
Returns:
A promise for the scoreboard information.
- Type
- DewPromise.<ScoreboardInfo>
(static) getSessionInfo(message, teamChat) → {DewPromise.<SessionInfo>}
(ASYNCHRONOUS) Gets information about the current game multiplayer session.
Parameters:
| Name | Type | Description |
|---|---|---|
message |
string | The chat message to send. |
teamChat |
boolean | If true the message is sent to team chat instead of global. |
Returns:
A promise for the game multiplayer session information.
- Type
- DewPromise.<SessionInfo>
(static) getStats(playerName) → {DewPromise.<StatsInfo>}
(ASYNCHRONOUS) Gets information about a player's stats.
Parameters:
| Name | Type | Description |
|---|---|---|
playerName |
string | The name of the player. |
Returns:
A promise for the player's stats.
- Type
- DewPromise.<StatsInfo>
(static) getVersion() → {DewPromise.<string>}
(ASYNCHRONOUS) Retrieves the current version of ElDewrito.
Returns:
- A promise for the version string.
- Type
- DewPromise.<string>
(static) hide(idopt)
Requests to hide a screen.
This will send a hide event to the screen if it is visible.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
id |
string |
<optional> |
The ID of the screen to hide. If this is null or omitted, the current screen will be hidden. |
(static) notify(eventNameopt, dataopt)
Sends a dew event to another screen
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
eventName |
string |
<optional> |
The name of the event for another screen to receive. |
data |
object |
<optional> |
Data to pass to the screen. |
(static) on(event, callback)
Registers a callback to be run when an event occurs.
Parameters:
| Name | Type | Description |
|---|---|---|
event |
string | The name of the event to register a callback for (e.g. "show"). |
callback |
EventCallback | The callback to register. |
- Source:
- See:
(static) ping(address) → {DewPromise}
(ASYNCHRONOUS) Pings a server.
The screen will receive a pong event if the server responds.
This method is currently broken and will report ping times that are much higher than they should be.
Parameters:
| Name | Type | Description |
|---|---|---|
address |
string | The IPv4 address of the server to ping. Must not include a port number. |
Returns:
A promise that will be resolved once the ping is sent.
- Type
- DewPromise
(static) sendChat(message, teamChat) → {DewPromise.<boolean>}
(ASYNCHRONOUS) Sends a chat message.
Parameters:
| Name | Type | Description |
|---|---|---|
message |
string | The chat message to send. |
teamChat |
boolean | If true the message is sent to team chat instead of global. |
Returns:
A promise for the success of sending the message.
- Type
- DewPromise.<boolean>
(static) show(idopt, dataopt)
Requests to show a screen.
If the requested screen is still loading, it will not be shown until it finishes.
This will always send a show event to the screen, even if it is already visible. You can use this as a simple means of sending messages between screens.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
id |
string |
<optional> |
The ID of the screen to show. If this is null or omitted, the current screen will be shown. |
data |
object |
<optional> |
Data to pass to the screen's show event. |
(static) submitVirtualKeyboard(value) → {DewPromise}
(ASYNCHRONOUS) Requests to submit the currently-active virtual keyboard.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
string | The value to submit. |
Returns:
A promise that will be resolved once the keyboard is submitted.
- Type
- DewPromise