Client: {
    address: string;
    color: string | number[] | { tint: number };
    inInput: boolean;
    mainOutput: string;
    mainWebStyle: string;
    mapView: object;
    maxFPS: number;
    mob: Diob;
    preventServerInterfaces: boolean;
    screenBackground: string | null;
    screenView: unknown;
    viewEyeDelay: { max: { x: number; y: number }; step: number };
    webBackground: string;
    xEdgeLimit: number;
    xViewEyeOffset: number;
    yEdgeLimit: number;
    yViewEyeOffset: number;
    addCommand(pCommand: string, pFunc: Function): void;
    addCustomFont(
        pName: string | number,
        pPath: string,
        pRemote?: unknown,
        pStyle?: object,
    ): void;
    addCustomMacro(
        pName: string | number,
        pKey: string,
        pDown?: string,
        pUp?: string,
    ): void;
    addFilter(pName: string | number, pType: string, pArgs: unknown): void;
    addInterfaceElement(
        pType: string,
        pInterface: string,
        pName?: string | number,
        pX?: number,
        pY?: number,
        pArgs?: unknown[],
    ): Diob;
    addOverlay(
        pOver: string | Diob | Object,
        pAppearance?: number | boolean,
        pSkipEvent?: boolean,
    ): Diob;
    addWebScript(
        pName: string | number,
        pLink: unknown,
        pModule?: unknown,
        pFunc?: Function,
    ): void;
    addWebStyle(pName: string | number, pStyle: unknown): void;
    alert(pMes: string): void;
    callCommand(pCommand: string, pArgs: unknown[], pSend?: unknown): void;
    callWebTagEvent(pID: string, pEvent: unknown): void;
    changeServer(pAddres: unknown): void;
    checkInterfaceShown(pInt: unknown, pEl?: unknown): boolean;
    clearKeyDownEvents(): void;
    confirm(pMes: string, pFunc: Function): void;
    createInterface(pName: string | number): void;
    createTopScreen(
        pName: string | number,
        pLayer?: unknown,
        pSet?: object,
    ): void;
    endMove(pDir: string): void;
    evalWebScript(pScript: string): void;
    getAccountName(): string;
    getAddress(): string;
    getCustomMacroNames(): string[];
    getFilters(): string[];
    getFocus(): object;
    getFPS(): number;
    getInterfaceCanvas(pInt: unknown, pEl: unknown): HTMLCanvasElement;
    getInterfaceElement(pInterface: string, pElement: Diob): Diob;
    getInterfaceElements(
        pInterface: string,
        pType?: string,
        pChild?: boolean,
    ): Diob[];
    getInterfaceElementsFromScreen(
        pX: number,
        pY: number,
        pType?: string,
        pChild?: boolean,
        pPage?: string,
    ): Diob[];
    getInterfaceNames(): string[];
    getLocalStorage(pKey: unknown): Storage;
    getMapView(): object;
    getMouseCursor(): { cursor: string; x: number; y: number };
    getMousePos(): { x: number; y: number };
    getNavigator(): Navigator;
    getOverlays(pType?: string, pChild?: boolean): Diob[];
    getPlane(pPlane?: number): Diob | Diob[];
    getPosFromScreen(
        pX: number,
        pY: number,
        pO?: object,
    ): { x: number; y: number };
    getScreenPos(pO?: object): { x: number; y: number };
    getScreenScale(pO?: object): { x: number; y: number };
    getScreenSize(pO?: object): { height: number; width: number };
    getScreenView(): object;
    getTopScreen(pName?: string | number, pType?: string): void;
    getViewEye(): Diob;
    getViewEyeDelay(): { max: { x: number; y: number }; step: number };
    getViewEyeOffsets(): { x: number; y: number };
    getWebTag(pID: string): HTMLElement;
    getWebTagContent(pID: string): string;
    getWindowSize(pO?: object): { height: number; width: number };
    hideInterface(pInterface: string, pElement?: Diob): void;
    outputText(pText: string, pInt: string, pEl: string): void;
    playSound(
        pSound: string | { soundName: string; volume: number },
        pStart?: unknown,
        pDuration?: unknown,
    ): void;
    prompt(pTitle: unknown, pMes: string, pFunc: Function): void;
    removeCommand(pCommand: string): void;
    removeCustomFont(pName: string | number): void;
    removeCustomMacro(pName: string | number): void;
    removeFilter(pName: string | number): void;
    removeInterfaceElement(pInterface: string, pName: string | number): void;
    removeOverlay(pOver: string | Diob | Object): void;
    removeWebScript(pName: string | number): void;
    removeWebStyle(pName: string | number): void;
    removeWebTag(pID: string): void;
    sendDiob(pD: Diob, pVar?: unknown[]): void;
    sendPacket(pName: string | number, pData: unknown, pForce?: boolean): void;
    setEdgeLimit(pX: number, pY: number): void;
    setFocus(): void;
    setLocalStorage(pKey: unknown, pData: unknown): void;
    setMacroAtlas(pMacro: string): void;
    setMainOutput(pOutput: string): void;
    setMapView(pView: object): void;
    setMaxFPS(pFPS: unknown): void;
    setMouseCursor(pCursor: string, pX?: number, pY?: number): void;
    setOverlays(pOver: Diob[]): void;
    setPlane(pPlane: number, pVar: string, pVal: boolean): void;
    setPlayerMob(pMob: Diob): void;
    setScreenBackground(pBack: string): void;
    setScreenSize(pWidth: number, pHeight: number): void;
    setScreenView(pView: object): void;
    setTopScreen(
        pName: string | number,
        pNewName: unknown,
        pNewLayer: unknown,
        pNewData?: unknown,
        pNewSet?: unknown,
    ): void;
    setViewEye(pDiob: Diob): void;
    setViewEyeDelay(pDelay: number): void;
    setViewEyeOffsets(pX: number, pY: number): void;
    setWebBackground(pBack: string): void;
    setWebTagContent(pID: string, pContent: string): void;
    setWebTagFocus(pID: string): void;
    setWebTagStyle(pID: string, pStyle: unknown, pValue: string): void;
    showInterface(pInterface: string, pElement?: Diob, pForce?: boolean): void;
    startMove(pDir: string): void;
    toggleLoadScreen(pVal?: boolean): void;
    toggleMacroCapture(pVal?: boolean): void;
    toggleScreenDrawing(pVal?: boolean): void;
    topScreenDraw(pArgs: object | object[], pName: string | number): void;
    [key: string]: any;
}

The client object.

Type declaration

  • [key: string]: any
  • address: string

    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)

    Client | Server

  • color: string | number[] | { tint: number }

    hex, rgb, rgba, color matrix value, or a tint object; applies color filter to diob; ex ( '#000000' ); ex ( 'rgb(10, 20, 30)' ); ex ( {'tint': 0x444444} )

    Client | Server

  • inInput: boolean

    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

    Client | Server

  • mainOutput: string

    name of the interface element to send default messages to (ex: 'interface1.output1' )

    Client | Server

  • mainWebStyle: string

    string containing CSS to be used as a web style (ex '.test{font-weight: bold;}.test2{color: #000;}' ); style can be referenced by the name 'default'

    Client | Server

  • mapView: object

    optional; if set, the map will not scale based on the window size

    Client | Server

  • maxFPS: number

    maximum number of frames the client will attempt to draw per second; default 60

    Client | Server

  • mob: Diob

    a reference to the player mob of this client

    Client | Server

  • preventServerInterfaces: boolean

    SERVER-ONLY; 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

    Server

  • screenBackground: string | null

    string containing a color (null for transparent) to set the client's screen background to, for example '#000' for black; default is '#000'

    Client | Server

  • screenView: unknown

    true or false; true acts the same as 'scaleNearest' when scaling, but it also removes smoothing caused by other things

    Client | Server

  • viewEyeDelay: { max: { x: number; y: number }; step: number }

    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}); ex {'step': 2, 'max': {'x': 100, 'y': 100}}

    Client | Server

  • webBackground: string

    a string containing the HTML to display behind the game screen; #web_background to set the style of the entire background

    Client | Server

  • xEdgeLimit: number

    amount of blank tiles that can be seen on the left and right of the view

    Client | Server

  • xViewEyeOffset: number

    amount of pixels the client's view is offset by from the view eye on the x-axis

    Client | Server

  • yEdgeLimit: number

    amount of blank tiles that can be seen on the top and bottom of the view

    Client | Server

  • yViewEyeOffset: number

    amount of pixels the client's view is offset by from the view eye on the y-axis

    Client | Server

  • addCommand:function
    • 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

      Parameters

      • pCommand: string

        name of the client command to be added

      • pFunc: Function

        function to be called when the command is executed

      Returns void

      Client | Server

  • addCustomFont:function
    • adds a custom font

      Parameters

      • pName: string | number

        name of the font

      • pPath: string

        url or path to the font file

      • OptionalpRemote: unknown

        optional; set this if the path is outside of the project

      • OptionalpStyle: object

        optional; custom style object to apply to the font; ex {'font-weight': bold}

      Returns void

      Client | Server

  • addCustomMacro:function
    • 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

      Parameters

      • pName: string | number

        name of the custom macro

      • pKey: string

        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'

      Returns void

      Client | Server

  • addFilter:function
    • adds the specified filter

      Parameters

      • pName: string | number

        name of the filter; only one name may be used at a time, using the name will remove the old filter with that name

      • pType: string

        the type of filter to add; below is the types and their specific possible pArgs values

      • pArgs: unknown

        color-based filter

      Returns void

      Client | Server

  • addInterfaceElement:function
    • adds an interface element to the interface and returns it

      Parameters

      • pType: string

        type of interface object to add

      • pInterface: string

        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 Diob

      returns it

      Client | Server

  • addOverlay:function
    • 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

      Parameters

      • pOver: string | Diob | Object

        string of the type of object or overlay to add an overlay of or actual diob to add

      • OptionalpAppearance: number | boolean

        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; ex {'shareIcon': true, 'isUnder': true}

      • OptionalpSkipEvent: boolean

        optional; if true, the onAddOverlay event will not be called

      Returns Diob

      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

      Client | Server

  • addWebScript:function
    • loads a JavaScript file into the project

      Parameters

      • pName: string | number

        name to give the script

      • pLink: unknown

        link to the JavaScript file to load

      • OptionalpModule: unknown

        optional; load script as a module

      • OptionalpFunc: Function

        optional; function to call after the JavaScript file has loaded

      Returns void

      Client | Server

  • addWebStyle:function
    • adds CSS style

      Parameters

      • pName: string | number

        unique name of style

      • pStyle: unknown

        text as CSS to add to the client

      Returns void

      Client | Server

  • alert:function
    • brings up an alert window with pMes in it

      Parameters

      • pMes: string

        message to show in the alert

      Returns void

      Client | Server

  • callCommand:function
    • calls the client command of pCommand with the arguments of pArgs

      Parameters

      • pCommand: string

        name of the client command to call

      • pArgs: unknown[]

        array of arguments to pass to the command

      • OptionalpSend: unknown

        CLIENT-ONLY; optional; if set the command will also be sent to the server

      Returns void

      Client

  • callWebTagEvent:function
    • executes the event pEvent of the web tag with the id pID

      Parameters

      • pID: string

        id of the web tag to call the event of

      • pEvent: unknown

        name of the event to call; onMouseDown, onMouseUp, onMouseClick, onMouseDblClick, onMouseMove

      Returns void

      Client | Server

  • changeServer:function
    • moves the client to a new server located at the address pAddress

      Parameters

      • pAddres: unknown

        address for the server to move the client to; example '127.0.0.1:1234'

      Returns void

      Client | Server

  • checkInterfaceShown:function
    • returns true if pInt is currently shown, false if not; if pEl is set, checks if the specified element is shown

      Parameters

      • pInt: unknown

        name of the interface

      • OptionalpEl: unknown

        optional; name of the element

      Returns boolean

      returns true if pInt is currently shown, false if not; if pEl is set, checks if the specified element is shown

      Client | Server

  • clearKeyDownEvents:function
    • clears all the keys the client is holding and calls their key up events; if the client continues to hold the key and once the user manually releases the key, the key event may still continue to trigger, so take that into consideration

      Returns void

      Client | Server

  • confirm:function
    • brings up a confirm window asking the user to select "yes" or "no"; returns true or false

      Parameters

      • pMes: string

        message to display in the confirm window

      • pFunc: Function

        function to call after input; the first argument will be the input; can be a "callback array" containing the function, the 'this', and arguments; ex ( [this.someFunc, this] )

      Returns void

      returns true or false

      Client | Server

  • createInterface:function
    • creates a new interface file named pName

      Parameters

      • pName: string | number

        name of the interface to create

      Returns void

      Client | Server

  • createTopScreen:function
    • creates a new top screen named pName with the layer pLayer

      Parameters

      • pName: string | number

        name of the top screen to create

      • OptionalpLayer: unknown

        optional; layer to give the screen

      • OptionalpSet: object

        optional; settings object; ex ( {'scaleType': 'nearest'} );

      Returns void

      Client | Server

  • endMove:function
    • ends movement of client.playerMob in the direction of pDir

      Parameters

      • pDir: string

        name of direction to stop moving the client's playerMob in; pDir being undefined ends all movement

      Returns void

      Client | Server

  • evalWebScript:function
    • evaluates the JavaScript code in the pScript string; returns undefined on the server-side

      Parameters

      • pScript: string

        a string containing the JavaScript code to evaluate

      Returns void

      returns undefined on the server-side

      Client | Server

  • getAccountName:function
    • returns the name of the account the client is logged in with

      Returns string

      returns the name of the account the client is logged in with

      Client | Server

  • getAddress:function
    • returns address of the client, 'localhost' for local or 'ip:port' if connected to a server

      Returns string

      returns address of the client, 'localhost' for local or 'ip:port' if connected to a server

      Client | Server

  • getCustomMacroNames:function
    • returns an array of custom macro names

      Returns string[]

      returns an array of custom macro names

      Client | Server

  • getFilters:function
    • returns an array of filter names

      Returns string[]

      returns an array of filter names

      Client | Server

  • getFocus:function
    • returns object currently being focused by this client

      Returns object

      returns object currently being focused by this client

      Client | Server

  • getFPS:function
    • returns the current FPS

      Returns number

      returns the current FPS

      Client | Server

  • getInterfaceCanvas:function
    • returns the canvas element that this element is drawn on to

      Parameters

      • pInt: unknown

        name of the interface that element is on

      • pEl: unknown

        name of the element

      Returns HTMLCanvasElement

      returns the canvas element that this element is drawn on to

      Client | Server

  • getInterfaceElement:function
    • returns the interface element object of the specified interface

      Parameters

      • pInterface: string

        name of the interface to get element from

      • pElement: Diob

        name of the element to get

      Returns Diob

      returns the interface element object of the specified interface

      Client | Server

  • getInterfaceElements:function
    • 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

      Parameters

      • pInterface: string

        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 Diob[]

      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

      Client | Server

  • getInterfaceElementsFromScreen:function
    • 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

      Parameters

      • pX: number

        starting x position

      • pY: number

        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 Diob[]

      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

      Client | Server

  • getInterfaceNames:function
    • returns an array of names of all created interfaces

      Returns string[]

      returns an array of names of all created interfaces

      Client | Server

  • getLocalStorage:function
    • gets the data as a string that is stored with the key pKey on the client's computer

      Parameters

      • pKey: unknown

        key used to get data stored locally on the client's computer

      Returns Storage

      Client | Server

  • getMapView:function
    • returns a mapView object containing the information of the client's mapView; for example {'width': 640, 'height': 640} would mean the client's mapView is 640 by 640 pixels in size

      Returns object

      returns a mapView object containing the information of the client's mapView; for example {'width': 640, 'height': 640} would mean the client's mapView is 640 by 640 pixels in size

      Client | Server

  • getMouseCursor:function
    • returns an object containing the cursor information; ex ( {'cursor': 'default', 'x': 0, 'y': 0} )

      Returns { cursor: string; x: number; y: number }

      returns an object containing the cursor information; ex ( {'cursor': 'default', 'x': 0, 'y': 0} )

      Client | Server

  • getMousePos:function
    • returns an object containing the mouse position; ex ( {'x': 0, 'y': 0} )

      Returns { x: number; y: number }

      returns an object containing the mouse position; ex ( {'x': 0, 'y': 0} )

      Client | Server

  • getNavigator:function
    • 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 Navigator

      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'}

      Client | Server

  • getOverlays:function
    • 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

      Parameters

      • OptionalpType: string

        optional; string containing type path to return

      • OptionalpChild: boolean

        optional; boolean that determines if child types are included

      Returns Diob[]

      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

      Client | Server

  • getPlane:function
    • 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

      Parameters

      • OptionalpPlane: number

        optional; value of plane to get

      Returns Diob | Diob[]

      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

      Client | Server

  • getPosFromScreen:function
    • 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

      Parameters

      • pX: number

        x position on the screen

      • pY: number

        y position on the screen

      • OptionalpO: object

        optional; an existing object to set the x and y of

      Returns { x: number; y: number }

      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

      Client | Server

  • getScreenPos:function
    • returns an object {'x': x, 'y': y} containing the x and y position of the client's screen on the map

      Parameters

      • OptionalpO: object

        optional; an existing object to set the x and y of

      Returns { x: number; y: number }

      returns an object {'x': x, 'y': y} containing the x and y position of the client's screen on the map

      Client | Server

  • getScreenScale:function
    • returns an object containing the x and y of the game scale; ex: {'x': 2, 'y': 2}

      Parameters

      • OptionalpO: object

        optional; an existing object to set the x and y of

      Returns { x: number; y: number }

      returns an object containing the x and y of the game scale; ex: {'x': 2, 'y': 2}

      Client | Server

  • getScreenSize:function
    • returns an object containing the width and height of the game screen; ex: {'width': 100, 'height': 100}

      Parameters

      • OptionalpO: object

        optional; an existing object to set the width and height of

      Returns { height: number; width: number }

      returns an object containing the width and height of the game screen; ex: {'width': 100, 'height': 100}

      Client | Server

  • getScreenView:function
    • returns a screenView object containing the information of the client's screenView; for example {'scaleTo': 'ratio', 'scaleNearest': true} would mean the client's screenView keeps its ratio and scales pixels to their nearest neighbor

      Returns object

      returns a screenView object containing the information of the client's screenView; for example {'scaleTo': 'ratio', 'scaleNearest': true} would mean the client's screenView keeps its ratio and scales pixels to their nearest neighbor

      Client | Server

  • getTopScreen:function
    • grabs an object with the screen name, layer, settings, and either an array of pixel data or a data url depending on pType for the entire screen named pName or the default top screen if no name is given. The array of pixel data can then be changed and used elsewhere or drawn onto another screen. To read the width and height you could use object.width and object.height, where object is the object returned by the function. The object data array is as follows: object.data[0] is the red value (0-255) of the pixel at 0,0, object.data[1] is the green value (0-255) of the pixel at 0,0, object.data[2] is the blue value (0-255) of the pixel at 0,0, and object.data[3] is the alpha value (0-255) of the pixel at 0,0. Then object.data[4], object.data[5], object.data[6], and object.data[7] are the respective values for the pixel at 1,0. This trend continues through the whole array for every pixel. object ex: {'name': '', 'layer': 1, 'data': ''}

      Parameters

      • OptionalpName: string | number

        optional; name of the top screen to get the data of

      • OptionalpType: string

        optional; type of data to get; 'url' or 'pixels' or 'canvas'

      Returns void

      Client | Server

  • getViewEye:function
    • returns the diob the client's screen eye is currently set to

      Returns Diob

      returns the diob the client's screen eye is currently set to

      Client | Server

  • getViewEyeDelay:function
    • returns an object {'step': step, 'max': {'x': x, 'y': y}} containing delay details of client's view eye

      Returns { max: { x: number; y: number }; step: number }

      returns an object {'step': step, 'max': {'x': x, 'y': y}} containing delay details of client's view eye

      Client | Server

  • getViewEyeOffsets:function
    • returns an object {'x': x, 'y': y} containing the x and y offsets of client's view eye

      Returns { x: number; y: number }

      returns an object {'x': x, 'y': y} containing the x and y offsets of client's view eye

      Client | Server

  • getWebTag:function
    • returns a reference to the web tag with the id pID

      Parameters

      • pID: string

        id of the web tag

      Returns HTMLElement

      returns a reference to the web tag with the id pID

      Client | Server

  • getWebTagContent:function
    • returns the content of the web tag with the id of pID

      Parameters

      • pID: string

        id of the web tag to get the content of

      Returns string

      returns the content of the web tag with the id of pID

      Client | Server

  • getWindowSize:function
    • returns an object containing the width and height of the game window; ex: {'width': 100, 'height': 100}

      Parameters

      • OptionalpO: object

        optional; an existing object to set the width and height of

      Returns { height: number; width: number }

      returns an object containing the width and height of the game window; ex: {'width': 100, 'height': 100}

      Client | Server

  • hideInterface:function
    • hides the interface of pInterface if pElement is not specified, otherwise it only hides pElement

      Parameters

      • pInterface: string

        name of the interface to hide or the interface containing pElement

      • OptionalpElement: Diob

        optional; name of interface lement in pInterface to hide

      Returns void

      Client | Server

  • outputText:function
    • outputs text to an interface element; if pInt or pEl is not set or is invalid, text goes to client.mainOutput

      Parameters

      • pText: string

        text to be displayed

      • pInt: string

        string containing interface file name to output to

      • pEl: string

        string containing the interface element name to output to

      Returns void

      Client | Server

  • playSound:function
    • plays a sound to this client; returns the Sound object

      Parameters

      • pSound: string | { soundName: string; volume: number }

        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: unknown

        optional; time to start playing the sound at

      • OptionalpDuration: unknown

        optional; how long to play the sound for

      Returns void

      returns the Sound object

      Client | Server

  • prompt:function
    • brings up a prompt window to ask for text from the user

      Parameters

      • pTitle: unknown

        title of the prompt

      • pMes: string

        default text in the input

      • pFunc: Function

        function to call after input; the first argument will be the input; can be a "callback array" containing the function, the 'this', and arguments; ex ( [this.someFunc, this] )

      Returns void

      Client | Server

  • removeCommand:function
    • removes the client command from the client's commands

      Parameters

      • pCommand: string

        name of the client command to remove

      Returns void

      Client | Server

  • removeCustomFont:function
    • removes a font from being usable

      Parameters

      • pName: string | number

        name of the font to remove

      Returns void

      Client | Server

  • removeCustomMacro:function
    • removes the custom macro pName from the client's custom macros

      Parameters

      • pName: string | number

        name of the custom macro

      Returns void

      Client | Server

  • removeFilter:function
    • removes the specified filter

      Parameters

      • pName: string | number

        name of filter to remove

      Returns void

      Client | Server

  • removeInterfaceElement:function
    • removes an interface element from the interface

      Parameters

      • pInterface: string

        name of the interface to remove an interface element from

      • pName: string | number

        name of the interface element to remove

      Returns void

      Client | Server

  • removeOverlay:function
    • removes all overlays with the pOver type or the exact overlay matching pOver

      Parameters

      • pOver: string | Diob | Object

        string of the type of object or overlay to remove or actual overlay to remove

      Returns void

      Client | Server

  • removeWebScript:function
    • removes the script with the pName name from the game

      Parameters

      • pName: string | number

        name of script to remove

      Returns void

      Client | Server

  • removeWebStyle:function
    • removes a CSS style with the name pName

      Parameters

      • pName: string | number

        unique name of style

      Returns void

      Client | Server

  • removeWebTag:function
    • removes a web tag with the id of pID from the client's screen

      Parameters

      • pID: string

        id of the web tag to remove from the client's screen

      Returns void

      Client | Server

  • sendDiob:function
    • 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

      Parameters

      • pD: Diob

        reference to the diob to send

      • OptionalpVar: unknown[]

        optional; variable name or array of variable names

      Returns void

      Server

  • sendPacket:function
    • 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

      Parameters

      • pName: string | number

        name of packet to send

      • pData: unknown

        an object containing data to be sent; ex {'a': 1, 'b': 2}

      • OptionalpForce: boolean

        optional; send the packet immediately instead of buffering it with the packet delay

      Returns void

      Client | Server

  • setEdgeLimit:function
    • sets the edge limit of the map for the client

      Parameters

      • pX: number

        number of black tiles visible on the left and right edges of the map; -1 for default

      • pY: number

        number of black tiles visible on the top and bottom edges of the map; -1 for default

      Returns void

      Client | Server

  • setFocus:function
    • focuses on the interface element object

      Returns void

      Client | Server

  • setLocalStorage:function
    • 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)

      Parameters

      • pKey: unknown

        key used to reference the stored data

      • pData: unknown

        data as a string to store locally for the client

      Returns void

      Client | Server

  • setMacroAtlas:function
    • changes the macro file the client uses

      Parameters

      • pMacro: string

        name of macro file to set client macros to

      Returns void

      Client | Server

  • setMainOutput:function
    • sets the client's mainOutput

      Parameters

      • pOutput: string

        name of the interface element to send default messages to (ex: 'interface1.output1' )

      Returns void

      Client | Server

  • setMapView:function
    • sets the client's mapView to pView or default if pView is null

      Parameters

      • pView: object

        an object containing new information for the client's mapView; for example {'width': 640, 'height': 640} would set the client's mapView to 640 by 640 pixels

      Returns void

      Client | Server

  • setMaxFPS:function
    • sets the client's max FPS to pFPS

      Parameters

      • pFPS: unknown

        cap the amount the FPS the client will try to reach when drawing the screen; default 60

      Returns void

      Client | Server

  • setMouseCursor:function
    • sets the cursor of the client

      Parameters

      • pCursor: string

        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

      Returns void

      Client | Server

  • setOverlays:function
    • sets the client's overlays to the array pOver

      Parameters

      • pOver: Diob[]

        array of overlays to set this client's overlays to

      Returns void

      Client | Server

  • setPlane:function
    • sets the variable pVar to pVal for the plane pPlane

      Parameters

      • pPlane: number

        value of plane to set

      • pVar: string

        string containing name of variable to set

      • pVal: boolean

        value to give this plane's pVar variable

      Returns void

      Client | Server

  • setPlayerMob:function
    • sets the client's playerMob to pMob

      Parameters

      • pMob: Diob

        reference to a Mob diob to give this client control of

      Returns void

      Client | Server

  • setScreenBackground:function
    • sets the background of the client's screen background

      Parameters

      • pBack: string

        string containing a color, for example '#000' for black

      Returns void

      Client | Server

  • setScreenSize:function
    • sets the client's game screen size to pWidth width and pHeight height

      Parameters

      • pWidth: number

        width as a number

      • pHeight: number

        height as a number

      Returns void

      Client | Server

  • setScreenView:function
    • sets the client's screenView to pView or default if pView is null

      Parameters

      • pView: object

        an object containing new information for the client's screenView; for example {'scaleTo': 'ratio', 'scaleNearest': true} would mean the client's screenView keeps its ratio and scales pixels to their nearest neighbor; 'scaleNearest' means pixels will stay pixelated and will not try to blend with other pixels, 'scaleTo': 'normal' means normal scaling, 'scaleTo': 'ratio' means the width and height of the window keep their aspect ratio when scaled, 'scaleTo': 'multiple' means the game will only show in scales that are multiples of two when scaled, 'scaleTo': 'none' prevents all scaling

      Returns void

      Client | Server

  • setTopScreen:function
    • changes the name and layer of the top screen with the name pName; adding data optional

      Parameters

      • pName: string | number

        name of the top screen to set

      • pNewName: unknown

        new name of the top screen

      • pNewLayer: unknown

        new layer of the top screen

      • OptionalpNewData: unknown

        optional; data to add to the screen

      • OptionalpNewSet: unknown

        optional; new settings object

      Returns void

      Client | Server

  • setViewEye:function
    • sets the view eye of the client to be centered on pDiob; the default is the player mob

      Parameters

      • pDiob: Diob

        diob to have the client's screen view centered on

      Returns void

      Client | Server

  • setViewEyeDelay:function
    • 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)

      Parameters

      • pDelay: number

        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}); ex {'step': 2, 'max': {'x': 100, 'y': 100}}

      Returns void

      Client | Server

  • setViewEyeOffsets:function
    • sets the client's view eye offsets

      Parameters

      • pX: number

        amount of pixels for the screen to be offset from the client's view eye on the x-axis

      • pY: number

        amount of pixels for the screen to be offset from the client's view eye on the y-axis

      Returns void

      Client | Server

  • setWebBackground:function
    • sets the HTML of the web box behind the game screen

      Parameters

      • pBack: string

        string containing HTML to set use in the web box behind the game screen

      Returns void

      Client | Server

  • setWebTagContent:function
    • sets the content of the web tag with the id pID to the value of pContent

      Parameters

      • pID: string

        id of the web tag to set the content of

      • pContent: string

        string containing the content to change the web tag's content to

      Returns void

      Client | Server

  • setWebTagFocus:function
    • sets the focus on the web tag with the id pID

      Parameters

      • pID: string

        id of the web tag to set focus to

      Returns void

      Client | Server

  • setWebTagStyle:function
    • sets the style of pStyle to the value of pValue of the web tag with the id pID

      Parameters

      • pID: string

        id of the web tag to set the style of

      • pStyle: unknown

        type of style to set

      • pValue: string

        value as a string to set the style to

      Returns void

      Client | Server

  • showInterface:function
    • 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

      Parameters

      • pInterface: string

        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

      Returns void

      Client | Server

  • startMove:function
    • moves the client.playerMob in the direction pDir until told to stop via endMove(pDir)

      Parameters

      • pDir: string

        name of direction to move client.playerMob

      Returns void

      Client | Server

  • toggleLoadScreen:function
    • toggles load screen on and off

      Parameters

      • OptionalpVal: boolean

        optional; true to show load screen, false to hide load screen

      Returns void

      Client | Server

  • toggleMacroCapture:function
    • toggles macro capturing on and off

      Parameters

      • OptionalpVal: boolean

        optional; true to resume capturing macros, false to pause capturing macros

      Returns void

      Client | Server

  • toggleScreenDrawing:function
    • toggles screen drawing on and off

      Parameters

      • OptionalpVal: boolean

        optional; true to resume screen drawing, false to pause all screen drawing, 'map' to pause only the map drawing

      Returns void

      Client | Server

  • topScreenDraw:function
    • performs the specified draw function using the specified pArgs object; ex ( {'type': 'image', 'image': this, 'x': 1, 'y': 1} )

      Parameters

      • pArgs: object | object[]

        an object or array of objects which determines the settings of the draw

      • pName: string | number

        type of draw

      Returns void

      Client | Server