Name of the client's account.
A string containing the address the client is connected to the server with (in format IP:port, or localhost if not connected to a server).
Hex, rgb, rgba, color matrix value, or a tint object. Applies color filter to diob. Example: ( #000000 ). Example: ( rgb(10, 20, 30) ). Example: ( {'tint': 0x444444} ).
CLIENT-ONLY. Toggles whether to hide the on-screen frames-per-second (FPS) DOM label element (#fps_label).
When true, the default FPS counter overlay is hidden from the client view.
When false, the FPS label element is displayed in the corner of the game screen and updated every second.
Set in order to tell the engine the client is in an input and key commands should be used as text input, false for normal. Engine automatically sets this for most inputs.
The name of the macro atlas currently active for this client.
Name of the default map file to load when the client connects or initializes.
When the client's controlled mob is created and does not already have an assigned map,
it is automatically placed onto this map at coordinates (0, 0).
Name of the interface element to send default messages to (ex: interface1.output1 ).
String containing CSS to be used as a web style (ex .test{font-weight: bold;}.test2{color: #000;}). Style can be referenced by the namedefault`.
Active MapView viewport controller instance for this client, or a configuration object when configuring the type.
Maximum number of frames the client will attempt to draw per second. Default is 60.
A reference to the player mob of this client.
CLIENT-ONLY. Controls whether off-screen display objects (Diobs) and map tiles are culled from rendering.
By default (false), the Vylocity engine performs screen frustum culling, automatically removing
non-visible map tiles and cullable Diobs from the screen display list to maximize rendering performance.
When set to true, screen culling is prevented, forcing all map tiles and objects within the map view
to remain added to the display list regardless of whether they are outside the current camera viewport.
Setting this will prevent the server from automatically loading interfaces on the server-side. If you want the server to have access, you will need to show the interface manually.
ReadonlyrenderCLIENT-ONLY. The underlying PixiJS Application instance managing the game canvas renderer (ScreenManager.pixiApp).
String containing a color (null for transparent) to set the client's screen background to, for example #000 for black. Default is #000.
Current screenView viewport configuration and state object for this client.
Object containing eye delay information. Possible values step (determines number of pixels the eye moves per frame. Default 1) and max (object determining maximum distance in pixels the screen can be from the eye {'x': 100, 'y': 100}). Example: {step: 2, max: {'x': 100, 'y': 100}}.
CLIENT-ONLY. Master volume level for sound playback on the client (default 100).
A string containing the HTML to display behind the game screen; #web_background to set the style of the entire background.
Amount of blank tiles that can be seen on the left and right of the view.
ReadonlyxCLIENT-ONLY. The current horizontal scroll position of the client's screen viewport in map pixels. Read-only.
Amount of pixels the client's view is offset by from the view eye on the x-axis.
Amount of blank tiles that can be seen on the top and bottom of the view.
ReadonlyyCLIENT-ONLY. The current vertical scroll position of the client's screen viewport in map pixels. Read-only.
Amount of pixels the client's view is offset by from the view eye on the y-axis.
Adds a new command to the client's commands. If pFunc is null and pCommand is the name of an pre-defined command, that command will be added.
Name of the client command to be added.
Function to be called when the command is executed.
Adds a custom font.
Name of the font.
Url or path to the font file.
OptionalpRemote: boolean(Optional) Set this if the path is outside of the project.
OptionalpStyle: object(Optional) Custom style object to apply to the font. Example: {'font-weight': bold}.
Creates a new custom macro named pName with the keyDown command of pDown and the keyUp command of pUp. Custom macros override macro atlas macros.
Name of the custom macro.
String of key that will execute the macro.
OptionalpDown: string(Optional) String containing the command to be executed when the key is pushed down. Example: test(1) would execute the test client command with one parameter equal to 1.
OptionalpUp: string(Optional) String containing the command to be executed when the key is let go of. Example: test(1) would execute the test client command with one parameter equal to 1.
Adds the specified filter.
Name of the filter. Only one name may be used at a time, using the name will remove the old filter with that name.
The type of filter to add. Below is the types and their specific possible pArgs values.
Color-based filter.
Adds an interface element to the interface and returns it.
Type of interface object to add.
Name of the interface to add the interface element to.
OptionalpName: string | number(Optional) Name to give the element being added.
OptionalpX: number(Optional) X position to give the element.
OptionalpY: number(Optional) Y position to the give the element.
OptionalpArgs: unknown[](Optional) Array of arguments to pass to the onNew event of the interface element being created.
Returns it.
Adds an overlay to the client which is a visual icon that always follows the screen. Returns the new overlay. If pOver is already an overlay of a diob it will remove it form that diob and add it to this diob.
String of the type of object or overlay to add an overlay of or actual diob to add.
OptionalpAppearance: AppearMask(Optional) If true, this overlay will be be treated as if it is part of the the parent's actual appearance - appearance settings such as angle and alpha of the parent will be used for this overlay and the overlay will be drawn directly on top of the parent so no other diobs that are not an overlay of the parent can appear between it and the parent (it will basically be an extension of the parent's icon). If this is false, the overlay will be treated as an independent diob that just follows the parent around. Instead of true or false this can be an object containing information on the appearMask, shareIcon to have the overlay share the same iconName as the parent and isUnder to make the overlay appear under the parent instead of above, ownState to have this overlay not sync up with the parent's iconState. Example: {'shareIcon': true, 'isUnder': true}.
OptionalpSkipEvent: boolean(Optional) If true, the onAddOverlay event will not be called.
Returns the new overlay. If pOver is already an overlay of a diob it will remove it form that diob and add it to this diob.
Loads a JavaScript file into the project.
Name to give the script.
Link to the JavaScript file to load.
OptionalpModule: boolean(Optional) Load script as a module.
OptionalpFunc: Function(Optional) Function to call after the JavaScript file has loaded.
Calls the client command of pCommand with the arguments of pArgs.
Name of the client command to call.
Array of arguments to pass to the command.
OptionalpSend: boolean(Optional) If set the command will also be sent to the server.
Returns true if pInt is currently shown, false if not. If pEl is set, checks if the specified element is shown.
Name of the interface.
OptionalpEl: string(Optional) Name of the element.
Returns true if pInt is currently shown, false if not. If pEl is set, checks if the specified element is shown.
Brings up a confirm window asking the user to select "yes" or "no". Returns true or false.
Message to display in the confirm window.
Function to call after input. The first argument will be the input. Can be a "callback array" containing the function, the this, and arguments. Example: ( [this.someFunc, this] ).
Returns true or false.
Creates a new top screen named pName with the layer pLayer.
Name of the top screen to create.
OptionalpLayer: number(Optional) Layer to give the screen.
OptionalpSet: object(Optional) Settings object. Example: ( {'scaleType': 'nearest'} ).
Ends movement of client.playerMob in the direction of pDir.
Name of direction to stop moving the client's playerMob in. PDir being undefined ends all movement.
Sets the background of the client's screen background.
Direction to stop moving in.
Retrieves an interface pane or an element within an interface pane.
pEl is omitted or undefined: returns the interface pane corresponding to pPane.pEl is specified: returns the child element within that interface pane named pEl.OptionalpPane: string | InterfacePaneName of the interface pane or the pane instance itself.
OptionalpEl: stringOptional name of the element within the interface pane.
The interface pane or the requested interface element.
Returns the canvas element that this element is drawn on to.
Name of the interface that element is on.
Name of the element.
Returns the canvas element that this element is drawn on to.
Returns the interface element object of the specified interface.
Name of the interface to get element from.
Name of the element to get.
Returns the interface element object of the specified interface.
Returns an array of interface elements on the interface pInterface depending on the provided arguments. If pType is not set, all elements on the interface will be returned. If pType is set but pChild is not, elements on the interface with the exact type of pType will be returned. If pType is set and pChild is set, all elements with the type pType or a parent type of pType will be returned. For example, if pType is set to Interface/A with pChild undefined, all elements with the exact type of Interface/A will be returned, but if pChild is set, then all types starting with Interface/A on the interface will be returned.
Name of the interface to get element from.
OptionalpType: string(Optional) String containing type path to return.
OptionalpChild: boolean(Optional) Boolean that determines if child types are included.
Returns an array of interface elements on the interface pInterface depending on the provided arguments. If pType is not set, all elements on the interface will be returned. If pType is set but pChild is not, elements on the interface with the exact type of pType will be returned. If pType is set and pChild is set, all elements with the type pType or a parent type of pType will be returned. For example, if pType is set to Interface/A with pChild undefined, all elements with the exact type of Interface/A will be returned, but if pChild is set, then all types starting with Interface/A on the interface will be returned.
Returns an array of diobs on the screen that overlap the specified position box depending on the provided arguments. If pType is not set, all diobs in the position box will be returned. If pType is set but pChild is not, diobs in the position box with the exact type of pType will be returned. If pType is set and pChild is set, all diobs with the type pType or a parent type of pType will be returned. For example, if pType is set to Interface with pChild undefined, all diobs with the exact type of Interface will be returned, but if pChild is set, then all interfaces on the screen will be returned.
Starting x position.
Starting y position.
OptionalpType: string(Optional) Ending x position.
OptionalpChild: boolean(Optional) Ending y position.
OptionalpPage: string(Optional) String containing type path to return.
Returns an array of diobs on the screen that overlap the specified position box depending on the provided arguments. If pType is not set, all diobs in the position box will be returned. If pType is set but pChild is not, diobs in the position box with the exact type of pType will be returned. If pType is set and pChild is set, all diobs with the type pType or a parent type of pType will be returned. For example, if pType is set to Interface with pChild undefined, all diobs with the exact type of Interface will be returned, but if pChild is set, then all interfaces on the screen will be returned.
Returns an object containing the cursor information. Example: ( {'cursor': 'default', 'x': 0, 'y': 0} ).
returns an object containing the cursor information. Example: ( {'cursor': 'default', 'x': 0, 'y': 0} ).
Returns an object containing information about the client's browser and operating system. Example: {'platform': 'Netscape', 'version': 'Chrome/38.0.2125.104', 'vendor': 'Google', 'language': 'en-US', 'system': 'Windows 95'}.
Returns an object containing information about the client's browser and operating system. Example: {'platform': 'Netscape', 'version': 'Chrome/38.0.2125.104', 'vendor': 'Google', 'language': 'en-US', 'system': 'Windows 95'}.
Returns an array of diobs that are overlays of this diob using the provided arguments. If pType is not set, all diobs will be returned. If pType is set but pChild is not, all diobs with the exact type of pType will be returned. If pType is set and pChild is set, all diobs with the type pType or a parent type of pType will be returned. For example, if pType is set to Mob with pChild undefined, all diobs with the exact type of Mob will be returned, but if pChild is set, then all mobs will be returned.
OptionalpType: string(Optional) String containing type path to return.
OptionalpChild: boolean(Optional) Boolean that determines if child types are included.
Returns an array of diobs that are overlays of this diob using the provided arguments. If pType is not set, all diobs will be returned. If pType is set but pChild is not, all diobs with the exact type of pType will be returned. If pType is set and pChild is set, all diobs with the type pType or a parent type of pType will be returned. For example, if pType is set to Mob with pChild undefined, all diobs with the exact type of Mob will be returned, but if pChild is set, then all mobs will be returned.
Returns the diob plane pPlane ir specified, otherwise returns an array of existing planes. You can then alter it like any other diob and all visual changes will be applied to all diobs on this plane.
OptionalpPlane: number(Optional) Value of plane to get.
Returns the diob plane pPlane ir specified, otherwise returns an array of existing planes. You can then alter it like any other diob and all visual changes will be applied to all diobs on this plane.
Returns an object {'x': x, 'y': y} containing the x and y position on the map that currently matches the pX and pY position on the screen.
X position on the screen.
Y position on the screen.
OptionalpO: object(Optional) An existing object to set the x and y of.
returns an object {'x': x, 'y': y} containing the x and y position on the map that currently matches the pX and pY position on the screen.
Returns an array of diobs that are currently on the screen.
OptionalpType: string(Optional) String containing type path to return.
OptionalpChild: boolean(Optional) Boolean that determines if child types are included.
Returns an array of diobs that are currently on the screen.
Returns an object containing the x and y of the game scale. Example:: {'x': 2, 'y': 2}.
OptionalpO: object(Optional) An existing object to set the x and y of.
returns an object containing the x and y of the game scale. Example:: {'x': 2, 'y': 2}.
Captures screen data for the entire top screen surface named pName (or default if omitted).
OptionalpName: string | numberOptional identifier name of the top screen layer to capture.
OptionalpType: "url" | "pixels" | "canvas"Type of representation: 'url', 'pixels', or 'canvas'.
Screen capture details and pixel/data payload.
Returns an object {step: step, max: {'x': x, 'y': y}} containing delay details of client's view eye.
returns an object {step: step, max: {'x': x, 'y': y}} containing delay details of client's view eye.
Hides the interface of pInterface if pElement is not specified, otherwise it only hides pElement.
Name of the interface to hide or the interface containing pElement.
OptionalpElement: Diob(Optional) Name of interface lement in pInterface to hide.
Outputs text to an interface element. If pInt or pEl is not set or is invalid, text goes to client.mainOutput.
Text to be displayed.
String containing interface file name to output to.
String containing the interface element name to output to.
Plays a sound to this client. Returns the Sound object.
either a string with the name of a sound file, or a string containing the path of a Sound object, or an actual Sound object, or a basic object with the proper information; ex ( {'soundName': 'name', 'volume': 50} )
OptionalpStart: number(Optional) Time in seconds to start playing the sound at.
OptionalpDuration: number(Optional) How long in seconds to play the sound for.
Returns the Sound object.
Brings up a prompt window to ask for text from the user.
Title of the prompt.
Default text in the input.
Function to call after input. The first argument will be the input. Can be a "callback array" containing the function, the this, and arguments. Example: ( [this.someFunc, this] ).
Removes an interface element from the interface.
Name of the interface (or InterfacePane instance) to remove an interface element from.
OptionalpName: string | number | DiobOptional name of the interface element or Diob element instance to remove.
OptionalpSave: booleanOptional flag indicating whether to keep the element instance from being deleted.
Sends the data for the pD diob to the client, if pVar is set it will send only those variables, if it is not set it will only send built-in engine variables.
Reference to the diob to send.
OptionalpVar: string[](Optional) Variable name or array of variable names.
Sends a packet to a client or server, depending on where the code is executed. Client code executing this will send the packet to the server. Server code executing this will send the packet to the client. This will invoke Client/onPacket on client-side if the sendPacket is server-side and on the server-side if it is on the client-side.
Name of packet to send.
An object containing data to be sent. Example: {'a': 1, 'b': 2}.
OptionalpForce: boolean(Optional) Send the packet immediately instead of buffering it with the packet delay.
Sets the edge limit of the map for the client.
Number of black tiles visible on the left and right edges of the map; -1 for default.
Number of black tiles visible on the top and bottom edges of the map; -1 for default.
Stores pData as a string locally on the client's computer and can be referenced using pKey. Leaving pKey and pData blank will clear all local storage; 3000 characters are allowed to be saved per game (keys and values combined).
OptionalpKey: stringKey used to reference the stored data.
OptionalpData: stringData as a string to store locally for the client.
Configures or updates the client's mapView viewport settings (dimensions, zoom bounds, padding).
Passing null resets the mapView to default settings.
OptionalpView: null | string | Partial<MapViewConfig>MapView configuration options or preset string.
Sets the cursor of the client.
A string containing the name of the cursor for built-in cursors, a URL path to an image, or a diob. Built-in (auto, all-scroll, crosshair, default, help, inherit, move, pointer, progress, text, vertical-text, wait, no-drop, not-allowed, e-resize, n-resize, s-resize, w-resize, col-resize, row-resize, ne-resize, nw-resize, se-resize, sw-resize). Passing a diob will use the diob's icon. Blank for default.
OptionalpX: number(Optional) Offsets the icon left or right by pX pixels.
OptionalpY: number(Optional) Offsets the icon up or down by pY pixels.
Sets the variable pVar to pVal for the plane pPlane.
Value of plane to set.
OptionalpVar: string(Optional) String containing name of variable to set.
OptionalpVal: boolean(Optional) Value to give this plane's pVar variable.
Configures the client's screenView settings (scaling policies, pixel ratio, rendering resolutions).
Passing null restores default viewport scaling settings.
OptionalpView: null | Partial<ScreenView>Screen view viewport configuration options.
Changes the name and layer of the top screen with the name pName. Adding data optional.
Name of the top screen to set.
New name of the top screen.
New layer of the top screen.
OptionalpNewData: any(Optional) Data to add to the screen.
OptionalpNewSet: object(Optional) New settings object.
Sets the client's view eye delay which is how many pixels the screen can be off center of the view eye and how quickly it catches up to the view eye. Set step to 0 for no delay (the default).
Object containing eye delay information. Possible values step (determines number of pixels the eye moves per frame. Default 0) and max (object determining maximum distance in pixels the screen can be from the eye {'x': 100, 'y': 100}). Example: {step: 2, max: {'x': 100, 'y': 100}}.
Sets the style of pStyle to the value of pValue of the web tag with the id pID.
Id of the web tag to set the style of.
Type of style to set.
Value as a string to set the style to.
Displays the interface of pInterface, if not already displayed, along with all elements of the interface with that are not hidden by default. If pElement is specified, it makes that element no longer hidden.
Name of interface to show.
OptionalpElement: Diob(Optional) Name of interface element in pInterface to show.
OptionalpForce: boolean(Optional) If set, all hidden elements will be forced to be shown.
Executes 2D canvas drawing commands onto the top screen surface named pName.
A draw command configuration object or array of draw commands.
Target top screen identifier name or layer index.
CLIENT-ONLY. Prompts the user to select one or more local files for upload, optionally posting them as multipart form data to pURL.
OptionalpURL: stringOptional target endpoint URL to upload files to via POST.
OptionalpOptions: Record<string, string>Optional HTML attributes to set on the hidden <input type="file"> element (such as accept, multiple).
Resolves with the server's text response if uploaded to pURL, or resolves with void.
OptionalonCLIENT-ONLY. Called when files are selected for upload via uploadFile.
Return false (or a Promise resolving to false) to cancel the upload.
The native FileList containing the selected files.
Return false to abort the upload; otherwise return true.
OptionalonOptionalonOptionalonCalled when a mouse button is clicked (press and release sequence) by this client.
The diob clicked, or 0 if clicked over empty space.
Horizontal coordinate of the click on the screen viewport.
Vertical coordinate of the click on the screen viewport.
The mouse button clicked (MouseButton.Left, MouseButton.Middle, or MouseButton.Right).
OptionalonCalled when a mouse button is double clicked by this client.
The diob double clicked, or 0 if double clicked over empty space.
Horizontal coordinate of the double click on the screen viewport.
Vertical coordinate of the double click on the screen viewport.
The mouse button clicked (MouseButton.Left, MouseButton.Middle, or MouseButton.Right).
OptionalonCalled when a mouse button is pressed by this client anywhere on screen or over a diob.
The diob instance underneath the cursor, or 0 if clicked on empty screen/map space.
Horizontal coordinate of the cursor on the screen viewport.
Vertical coordinate of the cursor on the screen viewport.
The mouse button that was pressed (MouseButton.Left, MouseButton.Middle, or MouseButton.Right).
OptionalonOptionalonOptionalonOptionalonCalled when a mouse button is released by this client.
The diob instance underneath the cursor, or 0 if released over empty screen/map space.
Horizontal coordinate of the cursor on the screen viewport.
Vertical coordinate of the cursor on the screen viewport.
The mouse button that was released (MouseButton.Left, MouseButton.Middle, or MouseButton.Right).
OptionalonCalled when the mouse wheel is scrolled downwards.
The diob underneath the cursor, or 0.
Horizontal viewport coordinate of the cursor.
Vertical viewport coordinate of the cursor.
OptionalonCalled when the mouse wheel is scrolled upwards.
The diob underneath the cursor, or 0.
Horizontal viewport coordinate of the cursor.
Vertical viewport coordinate of the cursor.
OptionalonCalled when a touch point is removed from the touch surface.
The diob instance underneath the touch point, or 0 if empty map/screen.
Horizontal coordinate of the touch point on the screen.
Vertical coordinate of the touch point on the screen.
OptionalpCancel: boolean(Optional) Whether the touch was cancelled (e.g. touchcancel event).
OptionalpEvent: TouchEvent(Optional) The native browser TouchEvent.
OptionalonCalled when a touch point is moved along the touch surface.
The diob instance underneath the touch point, or 0 if empty map/screen.
Horizontal coordinate of the touch point on the screen.
Vertical coordinate of the touch point on the screen.
OptionalpEvent: TouchEvent(Optional) The native browser TouchEvent.
OptionalonCalled when a touch point is placed on the touch surface.
The diob instance underneath the touch point, or 0 if empty map/screen.
Horizontal coordinate of the touch point on the screen.
Vertical coordinate of the touch point on the screen.
OptionalpEvent: TouchEvent(Optional) The native browser TouchEvent.
The client object.