If set, any movable with the same density as this diob may cross over it.
How visible the diob appears; (0 to 1); 0 completely invisible, 1 completely visible, between partially visible, higher the number the more visible.
Default is 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.
Angle of the diob (0 to 2PI).
If set, will share animation with all other diobs with the same sync id. Example: {'sync': 'water'}.
Name of atlas the object's icon is in.
Name of the lowest level parent type.
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.
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} ).
String containing composite value that determines how this diob is drawn with other diobs on the same plane. Possible values: normal, add, multiply, screen.
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.
OptionalfloatingHeight of the collision box of the object.
Name of icon inside object's icon atlas.
State of the icon.
Unique ID of the diob.
If set, diob will be invisible to all other diobs with visibility less than this value.
CLIENT-ONLY. Controls whether this diob is subject to screen frustum culling.
When true (default), the diob is removed from the active screen display list when outside the viewport.
ReadonlyisRead-only boolean flag indicating this object is a Diob.
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.
Order of display of the diob. Higher layer objects appear above lower layer objects.
The tile that the diob is on.
The current map instance this diob belongs to.
Name of the map.
Determines if the cursor executes mouse events on this diob or not.
MouseOpacity.Transparent (0): Ignores mouse events (cursor clicks pass through).MouseOpacity.Icon (1): Uses the object's visual icon bounds (iconWidth x iconHeight + icon offsets) to detect mouse events.MouseOpacity.Bounds (2): Uses the object's physical collision bounding box (width x height + origins) to detect mouse events.Name of object.
Name of the highest level parent type.
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).
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. Example: ( {'type': ['pos', 'dir'], 'client': [someClient]} ).
OptionalpreventControls whether this diob is exempt from spatial interest grid tracking and culling on the server.
If set, the client will not interpolate position changes.
If set, the client will not update the draw layer of this diob when it changes location on the screen.
The region that the diob is in.
Height to use when calculating y position relayering.
The scale factors { x: number, y: number } applied to the diob's visual rendering.
OptionalsnapCLIENT-ONLY. Accesses the underlying PixiJS Sprite instance used to render this diob's icon (_vy_pixS).
Custom string used to identify the diob.
A string to be displayed as text above the diob.
CLIENT-ONLY. Accesses the underlying PixiJS Text instance used to render this diob's text label (_vy_pixT).
Default is 0. Number of pixels to offset the text by on the y-axis.
Color tint applied to this diob's visual sprite (e.g. 0xFFFFFF for untinted, or a hexadecimal color number).
The diob's transformation matrix (9-element array) or 2D transformation object.
Array format: [scaleX, skewY, 0, skewX, scaleY, 0, moveX, moveY, 1]
Object format: { scaleX, skewY, skewX, scaleY, moveX, moveY }
Name of the type of the object.
All invisible diobs with invisibility levels equal to or less than this will be visible to this diob.
Width of the collision box of the object.
Position of object on the grid x-axis.
How many pixels object is offset on the grid x-axis from the xCoord.
X-axis offset of the icon.
Position on the x-axis of the origin from the left edge of the diob.
Position on the x-axis from left to right of the map.
Position of object on the grid y-axis.
How many pixels object is offset on the grid y-axis from its yCoord.
Position on the y-axis of the origin from the top edge of the diob.
Position on the y-axis from top to bottom of the map.
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 overlay to the object which is a visual icon that always follows the object. Returns the new overlay.
String of the type of object or overlay to add an overlay of or actual diob to get type from.
OptionalpAppearance: AppearMask(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 the new overlay.
Returns animation state information for the diob's currently active animation.
When called without arguments, returns an AnimationInfo object:
{ onFrame, frameCount, atlasName, iconName, iconState }.
When called with a specific key name, returns the corresponding scalar value.
Complete animation state object.
Returns an array of Diobs currently inside this diob's contents container.
OptionalpType: stringOptional type name filter (e.g. 'Item', 'Mob').
OptionalpChild: booleanIf true, includes instances of child/derived types matching pType.
Array of child Diob instances.
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.
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 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.
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.
Captures or retrieves over screen data for this diob (client-side only).
OptionalpType: "url" | "pixels" | "canvas" | "sprite"Type of data representation to retrieve.
Captured screen data object or undefined.
Returns data extracted from the internal rendering sprite of the diob (client-side only).
OptionalpType: "url" | "pixels" | "canvas"Format to extract: 'url' for base64 data URL string, 'pixels' for Uint8ClampedArray / ImageData, 'canvas' for HTMLCanvasElement. If omitted, returns the internal PIXI sprite reference.
Rendered sprite extraction data.
Returns the transformation matrix of this diob either as a 9-element array or as a TransformMatrixObject.
OptionalpAsObj: booleanIf true, returns an object { scaleX, skewY, skewX, scaleY, moveX, moveY } instead of a 9-element array.
The current 2D transformation matrix.
Removes all overlays with the pOver type or the exact overlay matching pOver.
String of the type of object or overlay to remove or actual overlay to remove.
OptionalpSave: boolean(Optional) If set, the overlay will not be deleted, otherwise this call will delete pOver after removing it from the overlays.
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.
Name of packet to send.
Data to be sent. Example: {'a': 1, 'b': 2} or test.
OptionalpClient: Client(Optional) 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.
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).
Default is 0. 5. X value of the diob's icon anchor.
OptionalpY: number(Optional) Default is 0. 5. Y value of the diob's icon anchor.
Changes the appearance of the diob based on the values provided by pDiob.
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.
Sets the animation frame to pFrame and freezes for pDelay milliseconds before returning to the previous frame or continuing on if pCont is set.
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.
Sets the diob's overlays to the array pOver.
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.
Changes the over screen information. Adding data optional.
X offset of display.
Y offset of display.
Width of display.
Height of display.
OptionalpData: unknown(Optional) Data to add to the screen.
OptionalpSet: object(Optional) Settings object. Example: ( {'scaleNearest': true} ).
Modifies the scale, angle, or alpha of this diob's over screen display.
Object containing modifications: scale, angle, alpha.
OptionalpAdd: boolean(Optional) If true, values in pMod will be added to the existing modifications.
Turns this diob's sprite into a repeating pattern. Call with no arguments to return to a normal sprite.
Default is 0. Position where the pattern starts on the x-axis.
Default is 0. Position where the pattern starts on the y-axis.
OptionalpWidth: number(Optional) Width of the pattern.
OptionalpHeight: number(Optional) Height of the pattern.
Moves the movable to the position pX and pY on the map named pMap.
Value to set the movable's x position on the map to.
Value to set the movable's y position on the map to.
OptionalpMap: string(Optional) String containing name of map to set position on.
Sets the scale of the diob.
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.
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.
Object containing properties to transition. Example: {'alpha': 0.5, 'xIconOffset': 20}.
Number of steps to take to transition the properties. Default is 1. -1 for a step every frame.
Number of milliseconds between each step. Default is 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.
OptionalonWhen 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.
Movable that is attempting to cross with this diob.
OptionalpInit: booleanIf set, pMovable initiated the event.
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).
Name of the old map or name of the new map if pBefore is set.
OptionalpBefore: booleanIf set then the map is currently loading and this is the pre-load event.
Called when a mouse button is clicked on this diob (press and release sequence).
The client instance originating the mouse click.
The horizontal coordinate of the mouse relative to the diob's origin.
The vertical coordinate of the mouse relative to the diob's origin.
The mouse button that was clicked (MouseButton.Left, MouseButton.Middle, or MouseButton.Right).
Called when a mouse button is double clicked on this diob.
The client instance originating the double click.
The horizontal coordinate of the mouse relative to the diob's origin.
The vertical coordinate of the mouse relative to the diob's origin.
The mouse button used (MouseButton.Left, MouseButton.Middle, or MouseButton.Right).
Called when a mouse button has been pressed while positioned over this diob.
The client instance whose mouse button was pressed.
The horizontal coordinate of the mouse relative to the diob's origin.
The vertical coordinate of the mouse relative to the diob's origin.
The mouse button that was pressed (MouseButton.Left, MouseButton.Middle, or MouseButton.Right).
Called when a mouse button is released while positioned over this diob.
The client instance whose mouse button was released.
The horizontal coordinate of the mouse relative to the diob's origin.
The vertical coordinate of the mouse relative to the diob's origin.
The mouse button that was released (MouseButton.Left, MouseButton.Middle, or MouseButton.Right).
Called when a mouse wheel button is scrolled downward while over this object.
Client of the mouse.
The x position of the mouse over the diob.
The y position of the mouse over the diob.
Called when a mouse wheel button is scrolled upward while over this object.
Client of the mouse.
The x position of the mouse over the diob.
The y position of the mouse over the diob.
OptionalonCalled when a packet is sent from this diob on the client or server using diob.sendPacket.
Client that sent the packet.
Name of packet.
Any data containing information for packet. Example: {'a': 1, 'b': 2} or test.
OptionalonCalled when a touch point is removed from over this diob.
The client whose touch was lifted.
Horizontal coordinate of the touch relative to the diob.
Vertical coordinate of the touch relative to the diob.
OptionalpCancel: boolean(Optional) Whether the touch was cancelled.
OptionalpEvent: TouchEvent(Optional) The native browser TouchEvent.
OptionalonCalled when a touch point moves over this diob.
The client whose touch moved.
Horizontal coordinate of the touch relative to the diob.
Vertical coordinate of the touch relative to the diob.
OptionalpEvent: TouchEvent(Optional) The native browser TouchEvent.
OptionalonCalled when a touch point is placed over this diob.
The client initiating the touch.
Horizontal coordinate of the touch relative to the diob.
Vertical coordinate of the touch relative to the diob.
OptionalpEvent: TouchEvent(Optional) The native browser TouchEvent.
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.
OptionalpVar: stringA string containing the name of the variable involved in the transition.
OptionalpChange: numberThe amount changed.
OptionalpStart: objectIf this is set then this is the event called when a transition starts. This will be a reference to the transition object used.
Optionalon
The diob object.