Diob: {
    allowDensityCross: boolean;
    alpha: number;
    anchor: { x: number; y: number };
    angle: number;
    animator: object;
    atlasName: string;
    baseType: string;
    clientSyncData: unknown;
    color: string | number[] | { tint: number };
    composite:
        | "source-over"
        | "source-atop"
        | "source-in"
        | "source-out"
        | "destination-over"
        | "destination-atop"
        | "destination-in"
        | "destination-out"
        | "lighter"
        | "copy"
        | "xor"
        | "multiply"
        | "screen"
        | "overlay"
        | "darken"
        | "lighten"
        | "color-dodge"
        | "color-burn"
        | "hard-light"
        | "soft-light"
        | "difference"
        | "exclusion"
        | "hue"
        | "saturation"
        | "color"
        | "luminosity";
    density: unknown;
    height: number;
    iconName: string;
    iconState: unknown;
    id: unknown;
    invisibility: number;
    isOverlay: unknown;
    layer: number;
    loc: unknown;
    mapName: string;
    mouseOpacity: unknown;
    name: unknown;
    number: any;
    parentType: unknown;
    plane: unknown;
    preventClientUpdates: unknown;
    preventInterpolation: unknown;
    preventScreenRelayer: boolean;
    region: unknown;
    relayerHeight: unknown;
    scale: unknown;
    tag: string;
    text: string;
    textStyle: object;
    transform: object
    | number[];
    type: string;
    visibility: number;
    width: number;
    xCoord: number;
    xCoordOffset: number;
    xIconOffset: number;
    xOrigin: number;
    xPos: number;
    yCoord: number;
    yCoordOffset: number;
    yIconOffset: number;
    yOrigin: number;
    yPos: number;
    addFilter(pName: string | number, pType: string, pArgs: unknown): void;
    addInvisibilityViewer(pDiob: Diob): void;
    addOverlay(
        pOver: string | Diob | Object,
        pAppearance?: number | boolean,
        pSkipEvent?: boolean,
    ): void;
    checkScreenShown(): void;
    getAnimation(pVal?: boolean): object;
    getContents(pType?: string, pChild?: boolean): unknown[];
    getCoordOffsets(): object;
    getCoords(): object;
    getCrossed(pType?: string, pChild?: boolean): Diob[];
    getFilters(): string[];
    getIcon(): object;
    getIconOffsets(): object;
    getInvisibilityViewers(): unknown[];
    getLocs(): Diob[];
    getMask(): Diob;
    getOrigin(): object;
    getOverlays(pType?: string, pChild?: boolean): Diob[];
    getOverScreen(pType: string): void;
    getOverScreenMod(): void;
    getPos(): { x: number; y: number };
    getSize(): object;
    getSpriteData(pType: string): void;
    getTransform(pAsObj?: unknown): void;
    onAddOverlay(pD: Diob): void;
    onBumped(pMovable: unknown): void;
    onClientSyncData(pOld: unknown): void;
    onCross(pMovable: unknown, pInit: unknown): void;
    onCrossed(pD: Diob, pInit: unknown): void;
    onCrossedRelocated(pD: Diob, pInit: unknown): void;
    onEntered(pDiob: Diob): void;
    onExited(pDiob: Diob): void;
    onIconUpdate(): void;
    onMapChange(pMap: string, pBefore: unknown): void;
    onMouseClick(
        pClient: Client,
        pX: number,
        pY: number,
        pButton: unknown,
    ): void;
    onMouseDblClick(
        pClient: Client,
        pX: number,
        pY: number,
        pButton: unknown,
    ): void;
    onMouseDown(
        pClient: Client,
        pX: number,
        pY: number,
        pButton: unknown,
    ): void;
    onMouseEnter(pClient: Client, pX: number, pY: number): void;
    onMouseExit(pClient: Client, pX: number, pY: number): void;
    onMouseMove(pClient: Client, pX: number, pY: number): void;
    onMouseUp(pClient: Client, pX: number, pY: number, pButton: unknown): void;
    onMouseWheelScrollDown(pClient: Client, pX: number, pY: number): void;
    onMouseWheelScrollUp(pClient: Client, pX: number, pY: number): void;
    onPacket(pClient: Client, pName: string | number, pData: unknown): void;
    onRemoveOverlay(pD: Diob): void;
    onScreenHide(pClient: Client): void;
    onScreenShow(pClient: Client): void;
    onTransition(pVar: string, pChange: unknown, pStart: object): void;
    onUncrossed(pDiob: Diob): void;
    overScreenDraw(pArgs: object | object[]): void;
    removeFilter(pName: string | number): void;
    removeInvisibilityViewer(pDiob: Diob): void;
    removeOverlay(pOver: string | Diob | Object, pSave?: unknown): void;
    sendPacket(pName: string | number, pData: unknown, pClient?: Client): void;
    setAnchor(pX: number, pY?: number): void;
    setAppearance(pDiob: Diob): void;
    setCoordOffsets(pX: number, pY: number): void;
    setFrame(pFrame: number, pDelay?: number, pCont?: boolean): void;
    setIcon(pAtlas: string, pIcon: string): void;
    setIconOffsets(pX: number, pY: number): void;
    setIconState(pState: string, pFrame?: number): void;
    setLoc(): Diob;
    setMask(pMask: Diob): void;
    setOrigin(pX: number, pY: number): void;
    setOverlays(pOver: Diob[], pSave?: boolean): void;
    setOverScreen(
        pX: number,
        pY: number,
        pWidth: number,
        pHeight: number,
        pData?: unknown,
        pSet?: object,
    ): void;
    setOverScreenMod(pMod: object, pAdd?: unknown): void;
    setPattern(pX: number, pY: number, pWidth?: number, pHeight?: number): void;
    setPos(pX: number, pY: number, pMap?: string): void;
    setScale(pX: number, pY?: number): void;
    setSize(pWidth: number, pHeight: number): void;
    setSpriteData(pData: unknown, pType?: string): void;
    setTransition(
        pO: object,
        pS: number,
        pT: number,
        pQ?: number,
        pLoop?: number,
        pEase?: string,
    ): void;
    [key: string]: any;
}

The diob object.

Type declaration

  • [key: string]: any
  • allowDensityCross: boolean

    if set, any movable with the same density as this diob may cross over it

    Client | Server

  • alpha: number

    how visible the diob appears; (0 to 1); 0 completely invisible, 1 completely visible, between partially visible, higher the number the more visible

    Client | Server

  • anchor: { x: number; y: number }

    default 0.5; number for both x and y anchors or an object containing both {'x': 0, 'y': 0}; determines where the icon's origin is

    Client | Server

  • angle: number

    angle of the diob (0 to 2PI)

    Client | Server

  • animator: object

    if set, will share animation with all other diobs with the same sync id; ex {'sync': 'water'}

    Client | Server

  • atlasName: string

    name of atlas the object's icon is in

    Client | Server

  • baseType: string

    name of the lowest level parent type

    Client | Server

  • clientSyncData: unknown

    data shared automatically from the server-side to clients that have a sync for this diob; changing the variable will update any clients that have this diob's sync in realtime

    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

  • composite:
        | "source-over"
        | "source-atop"
        | "source-in"
        | "source-out"
        | "destination-over"
        | "destination-atop"
        | "destination-in"
        | "destination-out"
        | "lighter"
        | "copy"
        | "xor"
        | "multiply"
        | "screen"
        | "overlay"
        | "darken"
        | "lighten"
        | "color-dodge"
        | "color-burn"
        | "hard-light"
        | "soft-light"
        | "difference"
        | "exclusion"
        | "hue"
        | "saturation"
        | "color"
        | "luminosity"

    string containing composite value that determines how this diob is drawn with other diobs on the same plane; possible values: normal, add, multiply, screen

    Client | Server

  • density: unknown

    determines if the object is dense or not; true or false for dense or not, or a number for value, over 1 for different densities; for example, density 3 diobs can move over density 2 and lower diobs but not anything density 3 or higher

    Client | Server

  • height: number

    height of the collision box of the object

    Client | Server

  • iconName: string

    name of icon inside object's icon atlas

    Client | Server

  • iconState: unknown

    state of the icon

    Client | Server

  • id: unknown

    unique ID of the diob

    Client | Server

  • invisibility: number

    if set, diob will be invisible to all other diobs with visibility less than this value

    Client | Server

  • isOverlay: unknown

    if this diob is an Overlay type or is being used as an overlay, this will be set; if the overlay has a parent diob, this will be a reference to that diob

    Client | Server

  • layer: number

    order of display of the diob; higher layer objects appear above lower layer objects

    Client | Server

  • loc: unknown

    the tile that the diob is on

    Client | Server

  • mapName: string

    name of the map

    Client | Server

  • mouseOpacity: unknown

    determines if the cursor executes mouse events on this object or not; 0 to ignore mouse events, 1 for icon size to determine mouse events, 2 for physical size to determine mouse events

    Client | Server

  • name: unknown

    name of object

    Client | Server

  • number: any
  • parentType: unknown

    name of the highest level parent type

    Client | Server

  • plane: unknown

    order of display of the diob; diobs with the same plane appear together with layers determining the order; a diob with a plane of 1 and layer 1000 will appear below a diob with plane 2 (default planes: Diob 0, Movable 1, Particle 2)

    Client | Server

  • preventClientUpdates: unknown

    SERVER-ONLY; if set, the server will not update clients when changes are made; can be 'true' to prevent all clients from getting updated or can be an object containing variables and/or specific clients to ignore; possible variables 'pos', 'dir', 'icon'; ex ( {'type': ['pos', 'dir'], 'client': [someClient]} )

    Server

  • preventInterpolation: unknown

    if set, the client will not interpolation position changes

    Client | Server

  • preventScreenRelayer: boolean

    CLIENT-ONLY; if set, the client will not update the draw layer of this diob when it changes location on the screen

    Client

  • region: unknown

    the region that the diob is in

    Client | Server

  • relayerHeight: unknown

    height to use when calculating y position relayering

    Client | Server

  • scale: unknown

    0 for no scale or an object {'x': 2, 'y': 2} containing the information for the scale

    Client | Server

  • tag: string

    custom string used to identify the diob

    Client | Server

  • text: string

    a string to be displayed as text above the diob

    Client | Server

  • textStyle: object

    default 0; number of pixels to offset the text by on the y-axis

    Client | Server

  • transform: object | number[]

    the diob's transformation matrix or transformation object; example [scaleX, skewY, 0, skewX, scaleY, 0, moveX, moveY, 1] where scaleX scales the diob's appearance on the x-axis, skewY skews on the y-axis, moveX moves on the x-axis, skewX skews on the x-axis, scaleY scales on the y-axis, moveY moves on the y-axis, and the last three are static for matrix; example {'scaleX': 2, 'skewY': 0.1} would scale by 2 on the x-axis and skew by 0.1 on the y-axis for object

    Client | Server

  • type: string

    name of the type of the object

    Client | Server

  • visibility: number

    all invisible diobs with invisibility levels equal to or less than this will be visible to this diob

    Client | Server

  • width: number

    width of the collision box of the object

    Client | Server

  • xCoord: number

    position of object on the grid x-axis

    Client | Server

  • xCoordOffset: number

    how many pixels object is offset on the grid x-axis from the xCoord

    Client | Server

  • xIconOffset: number

    x-axis offset of the icon

    Client | Server

  • xOrigin: number

    position on the x-axis of the origin from the left edge of the diob

    Client | Server

  • xPos: number

    position on the x-axis from left to right of the map

    Client | Server

  • yCoord: number

    position of object on the grid y-axis

    Client | Server

  • yCoordOffset: number

    how many pixels object is offset on the grid y-axis from its yCoord

    Client | Server

  • yIconOffset: number

    y-axis offset of the icon

    Client | Server

  • yOrigin: number

    position on the y-axis of the origin from the top edge of the diob

    Client | Server

  • yPos: number

    position on the y-axis from top to bottom of the map

    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

  • addInvisibilityViewer:function
    • adds pDiob to this diob's viewer array, allowing pDiob to always see this diob

      Parameters

      • pDiob: Diob

        the diob to add

      Returns void

      Client | Server

  • addOverlay:function
    • adds an overlay to the object which is a visual icon that always follows the object; returns the new overlay

      Parameters

      • pOver: string | Diob | Object

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

      • OptionalpAppearance: number | boolean

        optional; if 1 or positive, 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 or 0, the overlay will be treated as an independent diob that just follows the parent around; if -1 or negative it will be treated like if it was 1 but it will appear under the parent instead of above it

      • OptionalpSkipEvent: boolean

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

      Returns void

      returns the new overlay

      Client | Server

  • checkScreenShown:function
    • returns true if this Diob is currently shown on the screen, false if not

      Returns void

      returns true if this Diob is currently shown on the screen, false if not

      Client | Server

  • getAnimation:function
    • returns an object containing the information for the diob's current animation; current variables, onFrame for the current frame the animation is on, frameCount for total number of frames in the animation, atlasName for atlas of the current animation, iconName for icon name of current animation, iconState for state of current animation; example {'onFrame': 1, 'frameCount' 20, 'atlasName': '', 'iconName': '', 'iconState': ''}

      Parameters

      • OptionalpVal: boolean

        optional; string with name of specific value to get; options: 'onFrame', 'frameCount', 'atlasName', 'iconName', 'iconState'

      Returns object

      returns an object containing the information for the diob's current animation; current variables, onFrame for the current frame the animation is on, frameCount for total number of frames in the animation, atlasName for atlas of the current animation, iconName for icon name of current animation, iconState for state of current animation; example {'onFrame': 1, 'frameCount' 20, 'atlasName': '', 'iconName': '', 'iconState': ''}

      Client | Server

  • getContents:function
    • returns an array of diobs in the diob's contents using the provided arguments; if pType is not set, all diobs in the diob's contents 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 in the game 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 unknown[]

      returns an array of diobs in the diob's contents using the provided arguments; if pType is not set, all diobs in the diob's contents 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 in the game will be returned

      Client | Server

  • getCoordOffsets:function
    • returns an object {'x': x, 'y': y} containing the x and y coord offsets of the object

      Returns object

      returns an object {'x': x, 'y': y} containing the x and y coord offsets of the object

      Client | Server

  • getCoords:function
    • returns the coords of the diob with an object {'x': x, 'y': y}

      Returns object

      returns the coords of the diob with an object {'x': x, 'y': y}

      Client | Server

  • getCrossed:function
    • returns an array of diobs that are crossing 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 crossing 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

  • getFilters:function
    • returns an array of filter names

      Returns string[]

      returns an array of filter names

      Client | Server

  • getIcon:function
    • returns an object {'atlas': atlasName, 'icon': iconName} containing the diob's icon atlas and icon names

      Returns object

      returns an object {'atlas': atlasName, 'icon': iconName} containing the diob's icon atlas and icon names

      Client | Server

  • getIconOffsets:function
    • returns an object {'x': x,'y': y} containing the x and y icon offsets

      Returns object

      returns an object {'x': x,'y': y} containing the x and y icon offsets

      Client | Server

  • getInvisibilityViewers:function
    • returns an array of diobs currently in this diob's viewer array

      Returns unknown[]

      returns an array of diobs currently in this diob's viewer array

      Client | Server

  • getLocs:function
    • returns an array of locations the diob is on; if diob is a tile, it returns an array containing only itself

      Returns Diob[]

      returns an array of locations the diob is on; if diob is a tile, it returns an array containing only itself

      Client | Server

  • getMask:function
    • returns the current diob being used as a mask

      Returns Diob

      returns the current diob being used as a mask

      Client | Server

  • getOrigin:function
    • returns an object {'x': xOrigin, 'y': yOrigin} containing the diob's x and y origin offsets

      Returns object

      returns an object {'x': xOrigin, 'y': yOrigin} containing the diob's x and y origin offsets

      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

  • getOverScreen:function
    • grabs an object with the screen x offset, y offset, width, height, settings, and either an array of pixel data or a data url depending on pType (data returned client-side only). The 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: {'x': 0, 'y': 0, 'width': 100, 'height': 100, 'data': ''}

      Parameters

      • pType: string

        type of data to get; 'url', 'pixels', 'canvas', or 'sprite'

      Returns void

      Client

  • getOverScreenMod:function
    • returns the over screen mod

      Returns void

      returns the over screen mod

      Client | Server

  • getPos:function
    • returns an object {'x': x, 'y': y} containing the x and y positions of the diob on the map

      Returns { x: number; y: number }

      returns an object {'x': x, 'y': y} containing the x and y positions of the diob on the map

      Client | Server

  • getSize:function
    • returns an object {'width': width, 'height': height} containing the diob's width and height

      Returns object

      returns an object {'width': width, 'height': height} containing the diob's width and height

      Client | Server

  • getSpriteData:function
    • return data related to the internal sprite of the diob which

      Parameters

      • pType: string

        the type of data to get 'url' for data url, 'pixels' for array of pixel data, 'canvas' for an HTML canvas element

      Returns void

      Client | Server

  • getTransform:function
    • returns the transformation matrix of this diob

      Parameters

      • OptionalpAsObj: unknown

        optional; if set, the diob's transformation matrix will be returned as an object, for example {'scaleX': scaleX, 'skewY': skewY}

      Returns void

      returns the transformation matrix of this diob

      Client | Server

  • onAddOverlay:function
    • when this diob has an overlay added to it

      Parameters

      • pD: Diob

        the diob added as an overlay

      Returns void

      Client | Server

  • onBumped:function
    • when a movable bumps into this diob

      Parameters

      • pMovable: unknown

        movable that did the bumping

      Returns void

      Client | Server

  • onClientSyncData:function
    • calls on the client-side when clientSyncData is changed by the server

      Parameters

      • pOld: unknown

        old data in clientSyncData

      Returns void

      Client | Server

  • onCross:function
    • when pMovable attempts to cross this diob resulting in overlapping bounding boxes; this function must return 'true' in order for pMovable to cross; this event is called for both diobs if they are both movable; tiles do not have this event

      Parameters

      • pMovable: unknown

        movable that is attempting to cross with this diob

      • pInit: unknown

        if set, pMovable initiated the event

      Returns void

      Client | Server

  • onCrossed:function
    • when this diob and pD have overlapping bounding boxes

      Parameters

      • pD: Diob

        diob that crossed with this diob

      • pInit: unknown

        if set, pD was relocated and initiated the event

      Returns void

      Client | Server

  • onCrossedRelocated:function
    • when this diob and pD have overlapping bounding boxes and one of them changes position and stays overlapped

      Parameters

      • pD: Diob

        diob that is crossed with this diob

      • pInit: unknown

        if set, pD was relocated and initiated the event

      Returns void

      Client | Server

  • onEntered:function
    • when an object enters the contents of another object

      Parameters

      • pDiob: Diob

        object that entered

      Returns void

      Client | Server

  • onExited:function
    • when an object exits the contents of another object

      Parameters

      • pDiob: Diob

        object that exited

      Returns void

      Client | Server

  • onIconUpdate:function
    • when this diob changes icons

      Returns void

      Client | Server

  • onMapChange:function
    • when this diob changes maps; this event will be called twice if the map has not already been loaded, once before loading and once after the loading has completed (the first event will have pBefore set)

      Parameters

      • pMap: string

        name of the old map or name of the new map if pBefore is set

      • pBefore: unknown

        if set then the map is currently loading and this is the pre-load event

      Returns void

      Client | Server

  • onMouseClick:function
    • called when the mouse clicks this object

      Parameters

      • pClient: Client

        client of the mouse

      • pX: number

        the x position of the mouse over the diob

      • pY: number

        the y position of the mouse over the diob

      • pButton: unknown

        the button used; 1 for left, 2 for middle, 3 for right

      Returns void

      Client | Server

  • onMouseDblClick:function
    • called when the mouse double clicks this object

      Parameters

      • pClient: Client

        client of the mouse

      • pX: number

        the x position of the mouse over the diob

      • pY: number

        the y position of the mouse over the diob

      • pButton: unknown

        the button used; 1 for left, 2 for middle

      Returns void

      Client | Server

  • onMouseDown:function
    • called when a mouse button has been pressed while over this object

      Parameters

      • pClient: Client

        client of the mouse

      • pX: number

        the x position of the mouse over the diob

      • pY: number

        the y position of the mouse over the diob

      • pButton: unknown

        the button used; 1 for left, 2 for middle, 3 for right

      Returns void

      Client | Server

  • onMouseEnter:function
    • called when the mouse enters this object

      Parameters

      • pClient: Client

        client of the mouse

      • pX: number

        the x position of the mouse over the diob

      • pY: number

        the y position of the mouse over the diob

      Returns void

      Client | Server

  • onMouseExit:function
    • called when the mouse exits this object

      Parameters

      • pClient: Client

        client of the mouse

      • pX: number

        the x position of the mouse over the diob

      • pY: number

        the y position of the mouse over the diob

      Returns void

      Client | Server

  • onMouseMove:function
    • called when the mouse moves after entering this object

      Parameters

      • pClient: Client

        client of the mouse

      • pX: number

        the x position of the mouse over the diob

      • pY: number

        the y position of the mouse over the diob

      Returns void

      Client | Server

  • onMouseUp:function
    • called when a mouse button is released while over this object

      Parameters

      • pClient: Client

        client of the mouse

      • pX: number

        the x position of the mouse over the diob

      • pY: number

        the y position of the mouse over the diob

      • pButton: unknown

        the button used; 1 for left, 2 for middle, 3 for right

      Returns void

      Client | Server

  • onMouseWheelScrollDown:function
    • called when a mouse wheel button is scrolled downward while over this object

      Parameters

      • pClient: Client

        client of the mouse

      • pX: number

        the x position of the mouse over the diob

      • pY: number

        the y position of the mouse over the diob

      Returns void

      Client | Server

  • onMouseWheelScrollUp:function
    • called when a mouse wheel button is scrolled upward while over this object

      Parameters

      • pClient: Client

        client of the mouse

      • pX: number

        the x position of the mouse over the diob

      • pY: number

        the y position of the mouse over the diob

      Returns void

      Client | Server

  • onPacket:function
    • called when a packet is sent from this diob on the client or server using diob.sendPacket

      Parameters

      • pClient: Client

        client that sent the packet

      • pName: string | number

        name of packet

      • pData: unknown

        any data containing information for packet; ex {'a': 1, 'b': 2} or 'test'

      Returns void

      Client | Server

  • onRemoveOverlay:function
    • when this diob has an overlay removed from it

      Parameters

      • pD: Diob

        the diob that was removed from the overlays

      Returns void

      Client | Server

  • onScreenHide:function
    • when this diob leaves the client's screen view

      Parameters

      • pClient: Client

        a reference to the client

      Returns void

      Client | Server

  • onScreenShow:function
    • when this diob enters the client's screen view

      Parameters

      • pClient: Client

        a reference to the client

      Returns void

      Client | Server

  • onTransition:function
    • when this diob has a transition change; if pVar, pChange, and pStart are all unset then this is the event called when all transitions have ended

      Parameters

      • pVar: string

        a string containing the name of the variable involved in the transition

      • pChange: unknown

        the amount changed

      • pStart: object

        if this is set then this is the event called when a transition starts; this will be a reference to the transition object used

      Returns void

      Client | Server

  • onUncrossed:function
    • when this diob and pMovable no longer have overlapping bounding boxes

      Parameters

      • pDiob: Diob

        diob that uncrossed with this diob

      Returns void

      Client | Server

  • overScreenDraw: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

      Returns void

      Client | Server

  • removeFilter:function
    • removes the specified filter

      Parameters

      • pName: string | number

        name of filter to remove

      Returns void

      Client | Server

  • removeInvisibilityViewer:function
    • removed pDiob from this diob's viewer array

      Parameters

      • pDiob: Diob

        the diob 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

      • OptionalpSave: unknown

        optional; if set, the overlay will not be deleted, otherwise this call will delete pOver after removing it from the overlays

      Returns void

      Client | Server

  • sendPacket:function
    • sends a packet to a client or server specifically for this diob, 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 Diob/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

        data to be sent; ex {'a': 1, 'b': 2} or 'test'

      • OptionalpClient: Client

        SERVER ONLY; optional; specific client or array of clients to send this packet to; if no client is specified the packet will be sent to all clients currently synced with this diob

      Returns void

      Client | Server

  • setAnchor:function
    • sets this diob's icon anchor to pX and pY; default is 0.5,0.5 which is the center of the diob's icon (0,0 would be the top-left corner);

      Parameters

      • pX: number

        default 0.5; x value of the diob's icon anchor

      • OptionalpY: number

        optional; default 0.5; y value of the diob's icon anchor

      Returns void

      Client | Server

  • setAppearance:function
    • changes the appearance of the diob based on the values provided by pDiob

      Parameters

      • pDiob: Diob

        object containing the appearance information or a diob itself; values used: atlasName, iconName, iconState, width, height, layer, scale, color, alpha, transform, anchor, angle, composite, plane, text, textStyle, animator, overlays, overScreen

      Returns void

      Client | Server

  • setCoordOffsets:function
    • sets the coord offset of the object

      Parameters

      • pX: number

        the x offset from the xCoord

      • pY: number

        the y offset from the yCoord

      Returns void

      Client | Server

  • setFrame:function
    • sets the animation frame to pFrame and freezes for pDelay milliseconds before returning to the previous frame or continuing on if pCont is set

      Parameters

      • pFrame: number

        frame number

      • OptionalpDelay: number

        optional; delay in milliseconds to freeze the newly set frame for; passing in -1 will pause the animation until you unpause it by changing the diob's 'animator.isPaused' to false

      • OptionalpCont: boolean

        optional; if true, animation will play like normal after the frame delay; false will return the animation to the frame it was at before the set after the delay

      Returns void

      Client | Server

  • setIcon:function
    • changes display icon of object

      Parameters

      • pAtlas: string

        name of atlas icon is in

      • pIcon: string

        name of icon in pAtlas

      Returns void

      Client | Server

  • setIconOffsets:function
    • sets the x and y icon offsets

      Parameters

      • pX: number

        the x offset of the icon of this object

      • pY: number

        the y offset of the icon of this object

      Returns void

      Client | Server

  • setIconState:function
    • sets the icon state of the diob's icon

      Parameters

      • pState: string

        state of the icon to set

      • OptionalpFrame: number

        optional; if true, animation will start from the frame the last iconState left off on

      Returns void

      Client | Server

  • setLoc:function
    • moves this to specified location; if pVal1 and pVal2 are numbers, this is moved to the coordinate pVal1, pVal2; if pVal1 is an object but not a tile, this is moved to the location of object; if pVal1 is a tile, this is moved to that tile

      Returns Diob

      Client | Server

  • setMask:function
    • turns pMask into a mask which this diob interacts with; transparent portions of the pMask's icon will cut out those same spots from this diob's icon

      Parameters

      • pMask: Diob

        diob to use as a mask

      Returns void

      Client | Server

  • setOrigin:function
    • sets the x and y origin offsets

      Parameters

      • pX: number

        the x offset of the origin of this object from the left

      • pY: number

        the y offset of the origin of this object from the top

      Returns void

      Client | Server

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

      Parameters

      • pOver: Diob[]

        array of overlays to set this diob's overlays to

      • OptionalpSave: boolean

        optional; if set, removed overlays will not be deleted, otherwise this call will delete removed overlays after removing them from the overlays

      Returns void

      Client | Server

  • setOverScreen:function
    • changes the over screen information; adding data optional

      Parameters

      • pX: number

        x offset of display

      • pY: number

        y offset of display

      • pWidth: number

        width of display

      • pHeight: number

        height of display

      • OptionalpData: unknown

        optional; data to add to the screen

      • OptionalpSet: object

        optional; settings object; ex ( {'scaleNearest': true} );

      Returns void

      Client | Server

  • setOverScreenMod:function
    • modifies scale, angle, or alpha of the over screen

      Parameters

      • pMod: object

        object containing mods; scale, angle, alpha; ex ( {'angle': 0.8} )

      • OptionalpAdd: unknown

        optional; if set, the values in pMod will be added to the current mod object

      Returns void

      Client | Server

  • setPattern:function
    • turns this diob's sprite into a repeating pattern; call with no arguments to return to a normal sprite

      Parameters

      • pX: number

        default 0; position where the pattern starts on the x-axis

      • pY: number

        default 0; position where the pattern starts on the y-axis

      • OptionalpWidth: number

        optional; width of the pattern

      • OptionalpHeight: number

        optional; height of the pattern

      Returns void

      Client | Server

  • setPos:function
    • sets the movable's map position to pX, pY

      Parameters

      • pX: number

        value to set the movable's x position on the map to

      • pY: number

        value to set the movable's y position on the map to

      • OptionalpMap: string

        optional; string containing name of map to set position on

      Returns void

      Client | Server

  • setScale:function
    • sets the scale of the diob

      Parameters

      • pX: number

        number to scale the width of the diob by; for example 2 would be a 200% scale

      • OptionalpY: number

        optional; number to scale the height of the diob by; for example 2 would be a 200% scale; pX used if null

      Returns void

      Client | Server

  • setSize:function
    • sets the width and height of the diob

      Parameters

      • pWidth: number

        value to set the diob's width to

      • pHeight: number

        value to set the diob's height to

      Returns void

      Client | Server

  • setSpriteData:function
    • set the diob's sprite to pData

      Parameters

      • pData: unknown

        the data used as the sprite

      • OptionalpType: string

        optional; default 'url'; the type of data to get 'url' for data url

      Returns void

      Client | Server

  • setTransition:function
    • transitions this diob's pO properties from their current values to the new values over time; if pO is not set all transitions will be cancelled and all properties will automatically go to their end transition values; current allowed properties: alpha, angle, scale, xScale, yScale, xIconOffset, yIconOffset

      Parameters

      • pO: object

        object containing properties to transition; ex {'alpha': 0.5, 'xIconOffset': 20}

      • pS: number

        number of steps to take to transition the properties; default 1; -1 for a step every frame

      • pT: number

        number of milliseconds between each step; default 100; if pS is -1 then this is the total time

      • OptionalpQ: number

        optional; if set, this transition will be added to a queue and happen after the current transition finishes or the rest of the queue clears; set as -1 to merge this with the last thing in the queue

      • OptionalpLoop: number

        optional; if set, this transition will be added to the current loop of transitions and repeat until told to stop, if this transition is first, this can be set to a specify number to stop looping after that amount of loops; -1 to loop forever

      • OptionalpEase: string

        optional; use an easing equation that isn't linear; options: 'quadraticIn', 'quadraticOut', 'quadraticInOut', 'cubicIn', 'cubicOut', 'cubicInOut', 'quarticIn', 'quarticOut', 'quarticInOut', 'quinticIn', 'quinticOut', 'quinticInOut', 'sineIn', 'sineOut', 'sineInOut', 'expoIn', 'expoOut', 'expoInOut', 'circularIn', 'circularOut', 'circularInOut'

      Returns void

      Client | Server