@evitcastudio/kit 1.1.3 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3790 +0,0 @@
1
- declare global {
2
-
3
- type World = {
4
-
5
- /**
6
- * returns an array of diobs in the world depending on the provided arguments; if pType is not set, all diobs in the game 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
7
- * @env Client | Server
8
- * @param {string} [pType] - optional; string containing type path to return
9
- * @param {boolean} [pChild] - optional; boolean that determines if child types are included
10
- * @returns {Diob[]} returns an array of diobs in the world depending on the provided arguments; if pType is not set, all diobs in the game 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
11
- */
12
- getDiobs(pType?: string, pChild?: boolean): Diob[]
13
-
14
- /**
15
- * object that will become the contents of 'settings.json' file for your game server
16
- * @env Client | Server
17
- */
18
- serverSettings: {[key: string]: any, 'port'?: number,'name'?: string,'accessCode'?: 'string','secure'?: {'key': string, 'cert': string}}
19
-
20
- /**
21
- * alphanumeric string between 1 and 48 characters needed to list a server and use the api for the game
22
- * @env Client | Server
23
- */
24
- webAccessCode: string
25
-
26
- /**
27
- * SERVER-ONLY; default 10000; number of milliseconds to wait before pinging a client to see if it is still connected
28
- * @env Server
29
- */
30
- pingDelay: number
31
-
32
- /**
33
- * SERVER-ONLY; default port to use when hosting; if the host sets a port in settings.json that port will override this one
34
- * @env Server
35
- */
36
- mainPort: number
37
-
38
- /**
39
- * type of map to use; 'normal' or 'isometric'
40
- * @env Client | Server
41
- */
42
- mapMode: 'normal' | 'isometric'
43
-
44
- /**
45
- * a string containing the address of the server to automatically connect players to; example '127.0.0.1:1234'
46
- * @env Client | Server
47
- */
48
- mainServer: string
49
-
50
- /**
51
- * passes an array of objects containing information about the game servers currently online; example {'name': 'Server 1', 'address': '127.0.0.1:1234', 'players': 12, 'guests': 2} would be the data for a server named Server 1 with 12 players and 2 guests on it at 127.0.0.1:1234 address to pFunc
52
- * @env Client | Server
53
- * @param {Function} pFunc - function to call after the servers have been retrieved
54
- */
55
- getServers(pFunc: Function): void
56
-
57
- /**
58
- * returns an array of diobs in the world that have the tag pTag
59
- * @env Client | Server
60
- * @param {string} pTag - string containing tag to look for
61
- * @returns {Diob[]} returns an array of diobs in the world that have the tag pTag
62
- */
63
- getDiobsByTag(pTag: string): Diob[]
64
-
65
- /**
66
- * returns an object {'width': world.gameWidth, 'height': world.gameHeight} containing the width and height of the game
67
- * @env Client | Server
68
- * @returns {{'width': number, 'height': number}} returns an object {'width': world.gameWidth, 'height': world.gameHeight} containing the width and height of the game
69
- */
70
- getGameSize(): {'width': number, 'height': number}
71
-
72
- /**
73
- * closes the socket connection
74
- * @env Client | Server
75
- * @param {string} pAddress - address of server to open a socket to; example '127.0.0.1:1234'
76
- * @param {Function} pFunc - function to call once the socket has been opened; an object holding the socket information is passed into pFunc
77
- * @param {object} pSettings - object containing settings values; example: {'secure': true}
78
- */
79
- openWebSocket(pAddress: string, pFunc: Function, pSettings: object): void
80
-
81
- /**
82
- * name that the server's js file will have, default being 'server' making it 'server.js'
83
- * @env Client | Server
84
- */
85
- serverFileName: string
86
-
87
- /**
88
- * closes the host socket
89
- * @env Server
90
- * @param {number} pPort - the port to listen for sockets on
91
- * @param {Function} pFunc - the function to call once the host socket has started
92
- * @returns {any[]} returns an array of all the socket client objects
93
- */
94
- hostWebSocket(pPort: number, pFunc: Function): any[]
95
-
96
- /**
97
- * checks if Vylocity account pName is a subscriber of the game then calls pFunc; server-side only
98
- * @env Server
99
- * @param {string} pName - name of the Vyocity account to check sub of
100
- * @param {Function} pFunc - function to call after the sub check; function is called with up to two parameters where the first is true or false depending on if the account is a sub or not and the second is a string containing an error message if there was one
101
- */
102
- checkSub(pName: string, pFunc: Function): void
103
-
104
- /**
105
- * plays a sound to all objects in pArr; returns the Sound object
106
- * @env Client | Server
107
- * @param {string | {'soundName': string, 'volume': number}} pSound - 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} )
108
- * @param {any} [pArr] - optional list of objects to play sound to
109
- * @param {any} [pStart] - optional; time to start playing the sound at
110
- * @param {any} [pDuration] - optional; how long to play the sound for
111
- * @returns {void} returns the Sound object
112
- */
113
- playSound(pSound: string | {'soundName': string, 'volume': number}, pArr?: any, pStart?: any, pDuration?: any): void
114
-
115
- /**
116
- * sends a request of method pMethod to the url pLink and passes the response into pFunc
117
- * @env Client | Server
118
- * @param {string} pLink - string containing the link to send a request to; for example 'https://vylocity.com/'
119
- * @param {string} [pMethod] - optional; string containing method type of request, ex 'POST', 'GET'
120
- * @param {object} [pHeaders] - optional; object containing custom headers
121
- * @param {any} [pData] - optional; data to send with method 'POST'
122
- * @param {Function} [pFunc] - optional; function to call after the request has been sent and a response received, the arguments of the function will be (pData, pError) where pData is the data returned and pError the error (if there is one)
123
- */
124
- sendRequest(pLink: string, pMethod?: string, pHeaders?: object, pData?: any, pFunc?: Function): void
125
-
126
- /**
127
- * SERVER-ONLY; a string containing addresses allowed to use scripts to access and download resources from this game server (currently set for .vyr|.json|.txt files); default '*' which allows all addresses
128
- * @env Server
129
- */
130
- resourceOrigin: string
131
-
132
- /**
133
- * map to be loaded when the game starts
134
- * @env Client | Server
135
- */
136
- mainMap: string
137
-
138
- /**
139
- * a string containing the address of the server to download resources from (game server or web server); default '.' which is same address as the game; if using web server, add htaccess file in the resources folder to set header Access-Control-Allow-Origin ex of htaccess file: ( Header set Access-Control-Allow-Origin "*" ); this feature only works for the client of multiplayer, if playing solo the resources at the index location will be used and the server in multiplayer will use its own resource location
140
- * @env Client | Server
141
- */
142
- resourceServer: string
143
-
144
- /**
145
- * returns an object {'width': world.tileWidth, 'height': world.tileHeight} containing the width and height of the game tiles
146
- * @env Client | Server
147
- * @returns {{'width': number, 'height': number}} returns an object {'width': world.tileWidth, 'height': world.tileHeight} containing the width and height of the game tiles
148
- */
149
- getTileSize(): {'width': number, 'height': number}
150
-
151
- /**
152
- * gracefully reboot the server
153
- * @env Client | Server
154
- */
155
- reboot(): void
156
-
157
- /**
158
- * string containing the name of the default macro atlas
159
- * @env Client | Server
160
- */
161
- mainMacro: string
162
-
163
- /**
164
- * returns an array of objects that are in pArr depending on the provided arguments; if pType is not set, all objects in the game 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
165
- * @env Client | Server
166
- * @param {any[]} pArr - array to check for objects in
167
- * @param {string} [pType] - optional; string containing type path to return
168
- * @param {boolean} [pChild] - optional; boolean that determines if child types are included
169
- * @returns {any[]} returns an array of objects that are in pArr depending on the provided arguments; if pType is not set, all objects in the game 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
170
- */
171
- getObjectsFromArray(pArr: any[], pType?: string, pChild?: boolean): any[]
172
-
173
- /**
174
- * returns a string containing the address of the server or client; for example '1.2.3.4:1234' for server and 'localhost' always for client
175
- * @env Client | Server
176
- * @returns {string} returns a string containing the address of the server or client; for example '1.2.3.4:1234' for server and 'localhost' always for client
177
- */
178
- getHostAddress(): string
179
-
180
- /**
181
- * goes to pLink and passes the content of the page to pFunc once it is finished
182
- * @env Client
183
- * @param {string} pLink - string containing the link to read; for example 'http://vylocity.com/'
184
- * @param {Function} pFunc - function to call after the content has been retrieved
185
- * @param {any} [pMime] - CLIENT-ONLY; optional; set the mime type; ex text/html or application/octet-stream
186
- */
187
- getWebContent(pLink: string, pFunc: Function, pMime?: any): void
188
-
189
- /**
190
- * SERVER-ONLY; reference to the node process (https://nodejs.org/api/process.html); warning: for advanced users
191
- * @env Server
192
- */
193
- nodeProcess: NodeJS.Process
194
-
195
- /**
196
- * version of the game
197
- * @env Client | Server
198
- */
199
- gameVersion: string | number
200
-
201
- /**
202
- * displays pMes to the console
203
- * @env Client | Server
204
- * @param {string} pMes - message to display
205
- */
206
- log(pMes: string): void
207
-
208
- /**
209
- * returns a string containing the game version
210
- * @env Client | Server
211
- * @returns {string | number} returns a string containing the game version
212
- */
213
- getGameVersion(): string | number
214
-
215
- /**
216
- * outputs text to an interface element for all clients; if pInt or pEl is not set or is invalid, text goes to client.mainOutput
217
- * @env Client | Server
218
- * @param {string} pText - text to be displayed
219
- * @param {string} pInt - string containing interface file name to output to
220
- * @param {string} pEl - string containing the interface element name to output to
221
- */
222
- outputText(pText: string, pInt: string, pEl: string): void
223
-
224
- /**
225
- * SERVER-ONLY; a string containing the address that can access the API ( '*' to allow all ) or an array of strings for each address with access
226
- * @env Server
227
- */
228
- apiOrigin: string | string[]
229
-
230
- /**
231
- * sends a string message pMes to another server located at pAddress; game server getting the message must have World/apiOrigin set to allow the message
232
- * @env Client | Server
233
- * @param {string} pAddress - address of the server to send a message to
234
- * @param {string} pMes - string containing the message to send
235
- * @param {Function} [pCallback] - optional; function to call after the message has been sent; the function will have two arguments, the first being an error if there was one, the second being the response from the server (the return value of the World/onMessage)
236
- */
237
- sendMessage(pAddress: string, pMes: string, pCallback?: Function): void
238
-
239
- /**
240
- * called when a map finishes loading
241
- * @env Client | Server
242
- * @event
243
- * @param {string} pName - name of map that has loaded
244
- */
245
- onMapLoaded(pName: string): void
246
-
247
- /**
248
- * string containing the path of the mob for the player to control
249
- * @env Client | Server
250
- */
251
- mainMob: string
252
-
253
- /**
254
- * returns an array of all connected clients
255
- * @env Client | Server
256
- * @returns {Client[]} returns an array of all connected clients
257
- */
258
- getClients(): Client[]
259
-
260
- /**
261
- * terminates the connection and prevents any queued data from being processed
262
- * @env Server
263
- * @param {object} pDatabase - object containing database information
264
- * @param {Function} [pFunc] - optional; hostname of database; default localhost
265
- * @returns {object} returns one argument that contains any error information<br />
266
- called: returns the connection pool object after connecting to the MySQL database pDatabase
267
- */
268
- openMySQL(pDatabase: object, pFunc?: Function): object
269
-
270
- /**
271
- * returns a string containing information about what the code type is; code ran in solo will return 'local'; code ran in multi-player client will return 'client'; code ran on the server will return 'server'
272
- * @env Client | Server
273
- * @returns {'local' | 'client' | 'server'} returns a string containing information about what the code type is; code ran in solo will return 'local'; code ran in multi-player client will return 'client'; code ran on the server will return 'server'
274
- */
275
- getCodeType(): 'local' | 'client' | 'server'
276
-
277
- /**
278
- * gracefully shut down the server
279
- * @env Client | Server
280
- */
281
- shutdown(): void
282
-
283
- /**
284
- * returns the diob with the specified ID
285
- * @env Client | Server
286
- * @param {string} pID - id of the diob to get
287
- * @returns {Diob} returns the diob with the specified ID
288
- */
289
- getDiobByID(pID: string): Diob
290
-
291
- /**
292
- * an object containing width and height of tiles on the map {'width': 32, 'height': 32}; acts as the default size of diobs
293
- * @env Client | Server
294
- */
295
- tileSize: {'width': number, 'height': number}
296
-
297
- /**
298
- * a number; 1 for single player game, 2 for multi-player game, 3 for single and multi-player
299
- * @env Client | Server
300
- */
301
- playerMode: 1 | 2 | 3
302
-
303
- /**
304
- * returns a string contain server IP and port in 'ip:port' format
305
- * @env Client | Server
306
- * @returns {string} returns a string contain server IP and port in 'ip:port' format
307
- */
308
- getAddress(): string
309
-
310
- /**
311
- * sends a notification with the message pMessage to the Vylocity account pName and then calls pFunc; server-side only
312
- * @env Server
313
- * @param {string} pName - name of the Vyocity account to send notification to
314
- * @param {any} pMessage - message to send; 256 characters max
315
- * @param {Function} pFunc - function to call after the notification has been sent or attempted; function is called with up to two parameters where the first is true or false depending on the success of the send and the second is a string containing an error message if there was one
316
- */
317
- sendNotification(pName: string, pMessage: any, pFunc: Function): void
318
-
319
- /**
320
- * only manually set this if you are using the offline IDE and are setting the source to match the game id for vylocity.com
321
- * @env Client | Server
322
- */
323
- gameID: number
324
-
325
- /**
326
- * evaluates the JavaScript code in the pScript string; if the world is running on the server-side this code will be Node.js
327
- * @env Client | Server
328
- * @param {string} pScript - a string containing the JavaScript code to evaluate
329
- */
330
- evalWebScript(pScript: string): void
331
-
332
- /**
333
- * returns a number containing the game's player mode
334
- * @env Client | Server
335
- * @returns {number} returns a number containing the game's player mode
336
- */
337
- getPlayerMode(): number
338
-
339
- /**
340
- * array of files to preload when the game starts up or '*' to load all resources; if no name is provided, all resources of that type will be preloaded; for example [{'type': 'icon', 'name': 'icon1'}, {'type': 'sound'}] to load an icon named icon1 and all sound resources; all interface files and macro files are automatically preloaded; you may include remote resources by giving the object a 'remote' property and setting it to the web URL path of the resource
341
- * @env Client | Server
342
- */
343
- preloadResources: {'type': string, 'name': string}[] | '*'
344
-
345
- /**
346
- * kicks the client pClient and displays the pReason message to them if there is one
347
- * @env Client | Server
348
- * @param {Client} pClient - client to kick
349
- * @param {string} [pReason] - optional; message to display to the client being kicked
350
- */
351
- kickClient(pClient: Client, pReason?: string): void
352
-
353
- /**
354
- * SERVER-ONLY; default 50; number of milliseconds to wait before sending built-in engine packets (custom client packets are sent immediately)
355
- * @env Server
356
- */
357
- packetDelay: number
358
-
359
- /**
360
- * default 45; how many tiles to combine into chunks to improve efficiency for rendering and networking; recommended to use at least 1.5x map view, so if the map view is 1920x1080 and the tile size is 32x32, you would want at least 90 chunk (90x90 tiles); if a part of the remaining map (after other parts have been chunked) is smaller than the chunk size, it will be added to the nearest chunk instead
361
- * @env Client | Server
362
- */
363
- mapChunk: number
364
-
365
- /**
366
- * sends the data for the pD diob to all clients in the world, if pVar is set it will send only those variables, if it is not set it will only send built-in engine variables
367
- * @env Server
368
- * @param {Diob} pD - reference to the diob to send
369
- * @param {any[]} [pVar] - optional; variable name or array of variable names
370
- */
371
- sendDiob(pD: Diob, pVar?: any[]): void
372
-
373
- }
374
-
375
-
376
- type Object = {
377
-
378
- /**
379
- * object containing ticker details if in an active ticker; set to null to remove from ticker
380
- * @env Client | Server
381
- */
382
- inTicker: object
383
-
384
- /**
385
- * sets the pVal value of the pVar static variable belonging to the type pType; static variables are variables that belong to all Objects of this type collectively and are different than normal variables, usually static variables can only be set once, but VyScript static variables may be changed if that is what the developer wants
386
- * @env Client | Server
387
- * @param {any} pVar - name of the static variable to set
388
- * @param {boolean} pVal - value to give to the static variable
389
- */
390
- setStaticVariable(pVar: any, pVal: boolean): void
391
-
392
- /**
393
- * returns the static variable value belonging to the type pType
394
- * @env Client | Server
395
- * @param {any} pVar - name of the static variable to get
396
- * @returns {any} returns the static variable value belonging to the type pType
397
- */
398
- getStaticVariable(pVar: any): any
399
-
400
- }
401
-
402
-
403
- type Diob = {
404
-
405
- /**
406
- * returns true if this Diob is currently shown on the screen, false if not
407
- * @env Client | Server
408
- * @returns {void} returns true if this Diob is currently shown on the screen, false if not
409
- */
410
- checkScreenShown(): void
411
-
412
- /**
413
- * removes the specified filter
414
- * @env Client | Server
415
- * @param {string} pName - name of filter to remove
416
- */
417
- removeFilter(pName: string): void
418
-
419
- /**
420
- * sets the diob's overlays to the array pOver
421
- * @env Client | Server
422
- * @param {Diob[]} pOver - array of overlays to set this diob's overlays to
423
- * @param {boolean} [pSave] - optional; if set, removed overlays will not be deleted, otherwise this call will delete removed overlays after removing them from the overlays
424
- */
425
- setOverlays(pOver: Diob[], pSave?: boolean): void
426
-
427
- /**
428
- * 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
429
- * @env Client | Server
430
- * @event
431
- * @param {string} pVar - a string containing the name of the variable involved in the transition
432
- * @param {any} pChange - the amount changed
433
- * @param {object} pStart - if this is set then this is the event called when a transition starts; this will be a reference to the transition object used
434
- */
435
- onTransition(pVar: string, pChange: any, pStart: object): void
436
-
437
- /**
438
- * returns an array of diobs currently in this diob's viewer array
439
- * @env Client | Server
440
- * @returns {any[]} returns an array of diobs currently in this diob's viewer array
441
- */
442
- getInvisibilityViewers(): any[]
443
-
444
- /**
445
- * if set, diob will be invisible to all other diobs with visibility less than this value
446
- * @env Client | Server
447
- */
448
- invisibility: number
449
-
450
- /**
451
- * 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);
452
- * @env Client | Server
453
- * @param {number} pX - default 0.5; x value of the diob's icon anchor
454
- * @param {number} [pY] - optional; default 0.5; y value of the diob's icon anchor
455
- */
456
- setAnchor(pX: number, pY?: number): void
457
-
458
- /**
459
- * modifies scale, angle, or alpha of the over screen
460
- * @env Client | Server
461
- * @param {object} pMod - object containing mods; scale, angle, alpha; ex ( {'angle': 0.8} )
462
- * @param {any} [pAdd] - optional; if set, the values in pMod will be added to the current mod object
463
- */
464
- setOverScreenMod(pMod: object, pAdd?: any): void
465
-
466
- /**
467
- * 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
468
- * @env Client | Server
469
- */
470
- setLoc(): Diob
471
-
472
- /**
473
- * returns the current diob being used as a mask
474
- * @env Client | Server
475
- * @returns {Diob} returns the current diob being used as a mask
476
- */
477
- getMask(): Diob
478
-
479
- /**
480
- * a string to be displayed as text above the diob
481
- * @env Client | Server
482
- */
483
- text: string
484
-
485
- /**
486
- * adds pDiob to this diob's viewer array, allowing pDiob to always see this diob
487
- * @env Client | Server
488
- * @param {Diob} pDiob - the diob to add
489
- */
490
- addInvisibilityViewer(pDiob: Diob): void
491
-
492
- /**
493
- * when this diob and pD have overlapping bounding boxes and one of them changes position and stays overlapped
494
- * @env Client | Server
495
- * @event
496
- * @param {Diob} pD - diob that is crossed with this diob
497
- * @param {any} pInit - if set, pD was relocated and initiated the event
498
- */
499
- onCrossedRelocated(pD: Diob, pInit: any): void
500
-
501
- /**
502
- * turns this diob's sprite into a repeating pattern; call with no arguments to return to a normal sprite
503
- * @env Client | Server
504
- * @param {number} pX - default 0; position where the pattern starts on the x-axis
505
- * @param {number} pY - default 0; position where the pattern starts on the y-axis
506
- * @param {number} [pWidth] - optional; width of the pattern
507
- * @param {number} [pHeight] - optional; height of the pattern
508
- */
509
- setPattern(pX: number, pY: number, pWidth?: number, pHeight?: number): void
510
-
511
- /**
512
- * 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
513
- * @env Client | Server
514
- */
515
- density: any
516
-
517
- /**
518
- * name of icon inside object's icon atlas
519
- * @env Client | Server
520
- */
521
- iconName: string
522
-
523
- /**
524
- * adds the specified filter
525
- * @env Client | Server
526
- * @param {string} pName - name of the filter; only one name may be used at a time, using the name will remove the old filter with that name
527
- * @param {string} pType - the type of filter to add; below is the types and their specific possible pArgs values
528
- * @param {any} pArgs - color-based filter
529
- */
530
- addFilter(pName: string, pType: string, pArgs: any): void
531
-
532
- /**
533
- * position of object on the grid x-axis
534
- * @env Client | Server
535
- */
536
- xCoord: number
537
-
538
- /**
539
- * sets the width and height of the diob
540
- * @env Client | Server
541
- * @param {number} pWidth - value to set the diob's width to
542
- * @param {number} pHeight - value to set the diob's height to
543
- */
544
- setSize(pWidth: number, pHeight: number): void
545
-
546
- /**
547
- * called when a packet is sent from this diob on the client or server using diob.sendPacket
548
- * @env Client | Server
549
- * @event
550
- * @param {Client} pClient - client that sent the packet
551
- * @param {string} pName - name of packet
552
- * @param {any} pData - any data containing information for packet; ex {'a': 1, 'b': 2} or 'test'
553
- */
554
- onPacket(pClient: Client, pName: string, pData: any): void
555
-
556
- /**
557
- * called when the mouse clicks this object
558
- * @env Client | Server
559
- * @event
560
- * @param {Client} pClient - client of the mouse
561
- * @param {number} pX - the x position of the mouse over the diob
562
- * @param {number} pY - the y position of the mouse over the diob
563
- * @param {any} pButton - the button used; 1 for left, 2 for middle, 3 for right
564
- */
565
- onMouseClick(pClient: Client, pX: number, pY: number, pButton: any): void
566
-
567
- /**
568
- * the region that the diob is in
569
- * @env Client | Server
570
- */
571
- region: any
572
-
573
- /**
574
- * name of atlas the object's icon is in
575
- * @env Client | Server
576
- */
577
- atlasName: string
578
-
579
- /**
580
- * 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
581
- * @env Client | Server
582
- * @param {string} [pType] - optional; string containing type path to return
583
- * @param {boolean} [pChild] - optional; boolean that determines if child types are included
584
- * @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
585
- */
586
- getCrossed(pType?: string, pChild?: boolean): Diob[]
587
-
588
- /**
589
- * changes the appearance of the diob based on the values provided by pDiob
590
- * @env Client | Server
591
- * @param {Diob} 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
592
- */
593
- setAppearance(pDiob: Diob): void
594
-
595
- /**
596
- * sets the x and y origin offsets
597
- * @env Client | Server
598
- * @param {number} pX - the x offset of the origin of this object from the left
599
- * @param {number} pY - the y offset of the origin of this object from the top
600
- */
601
- setOrigin(pX: number, pY: number): void
602
-
603
- /**
604
- * if set, the client will not interpolation position changes
605
- * @env Client | Server
606
- */
607
- preventInterpolation: any
608
-
609
- /**
610
- * default 0; number of pixels to offset the text by on the y-axis
611
- * @env Client | Server
612
- */
613
- textStyle: object
614
-
615
- /**
616
- * name of the type of the object
617
- * @env Client | Server
618
- */
619
- type: string
620
-
621
- /**
622
- * unique ID of the diob
623
- * @env Client | Server
624
- */
625
- id: any
626
-
627
- /**
628
- * 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
629
- * @env Client | Server
630
- */
631
- transform: object | number[]
632
-
633
- /**
634
- * sets the scale of the diob
635
- * @env Client | Server
636
- * @param {number} pX - number to scale the width of the diob by; for example 2 would be a 200% scale
637
- * @param {number} [pY] - optional; number to scale the height of the diob by; for example 2 would be a 200% scale; pX used if null
638
- */
639
- setScale(pX: number, pY?: number): void
640
-
641
- /**
642
- * 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
643
- * @env Client | Server
644
- * @param {object} pO - object containing properties to transition; ex {'alpha': 0.5, 'xIconOffset': 20}
645
- * @param {number} pS - number of steps to take to transition the properties; default 1; -1 for a step every frame
646
- * @param {number} pT - number of milliseconds between each step; default 100; if pS is -1 then this is the total time
647
- * @param {number} [pQ] - 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
648
- * @param {number} [pLoop] - 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
649
- * @param {string} [pEase] - 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'
650
- */
651
- setTransition(pO: object, pS: number, pT: number, pQ?: number, pLoop?: number, pEase?: string): void
652
-
653
- /**
654
- * the tile that the diob is on
655
- * @env Client | Server
656
- */
657
- loc: any
658
-
659
- /**
660
- * when this diob leaves the client's screen view
661
- * @env Client | Server
662
- * @event
663
- * @param {Client} pClient - a reference to the client
664
- */
665
- onScreenHide(pClient: Client): void
666
-
667
- /**
668
- * returns the transformation matrix of this diob
669
- * @env Client | Server
670
- * @param {any} [pAsObj] - optional; if set, the diob's transformation matrix will be returned as an object, for example {'scaleX': scaleX, 'skewY': skewY}
671
- * @returns {void} returns the transformation matrix of this diob
672
- */
673
- getTransform(pAsObj?: any): void
674
-
675
- /**
676
- * returns the over screen mod
677
- * @env Client | Server
678
- * @returns {void} returns the over screen mod
679
- */
680
- getOverScreenMod(): void
681
-
682
- /**
683
- * returns an object {'atlas': atlasName, 'icon': iconName} containing the diob's icon atlas and icon names
684
- * @env Client | Server
685
- * @returns {object} returns an object {'atlas': atlasName, 'icon': iconName} containing the diob's icon atlas and icon names
686
- */
687
- getIcon(): object
688
-
689
- /**
690
- * 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': ''}
691
- * @env Client
692
- * @param {string} pType - type of data to get; 'url', 'pixels', 'canvas', or 'sprite'
693
- */
694
- getOverScreen(pType: string): void
695
-
696
- /**
697
- * angle of the diob (0 to 2PI)
698
- * @env Client | Server
699
- */
700
- angle: number
701
-
702
- /**
703
- * changes the over screen information; adding data optional
704
- * @env Client | Server
705
- * @param {number} pX - x offset of display
706
- * @param {number} pY - y offset of display
707
- * @param {number} pWidth - width of display
708
- * @param {number} pHeight - height of display
709
- * @param {any} [pData] - optional; data to add to the screen
710
- * @param {object} [pSet] - optional; settings object; ex ( {'scaleNearest': true} );
711
- */
712
- setOverScreen(pX: number, pY: number, pWidth: number, pHeight: number, pData?: any, pSet?: object): void
713
-
714
- /**
715
- * 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)
716
- * @env Client | Server
717
- * @event
718
- * @param {string} pMap - name of the old map or name of the new map if pBefore is set
719
- * @param {any} pBefore - if set then the map is currently loading and this is the pre-load event
720
- */
721
- onMapChange(pMap: string, pBefore: any): void
722
-
723
- /**
724
- * returns an object {'width': width, 'height': height} containing the diob's width and height
725
- * @env Client | Server
726
- * @returns {object} returns an object {'width': width, 'height': height} containing the diob's width and height
727
- */
728
- getSize(): object
729
-
730
- /**
731
- * custom string used to identify the diob
732
- * @env Client | Server
733
- */
734
- tag: string
735
-
736
- /**
737
- * all invisible diobs with invisibility levels equal to or less than this will be visible to this diob
738
- * @env Client | Server
739
- */
740
- visibility: number
741
-
742
- /**
743
- * called when the mouse double clicks this object
744
- * @env Client | Server
745
- * @event
746
- * @param {Client} pClient - client of the mouse
747
- * @param {number} pX - the x position of the mouse over the diob
748
- * @param {number} pY - the y position of the mouse over the diob
749
- * @param {any} pButton - the button used; 1 for left, 2 for middle
750
- */
751
- onMouseDblClick(pClient: Client, pX: number, pY: number, pButton: any): void
752
-
753
- /**
754
- * when an object exits the contents of another object
755
- * @env Client | Server
756
- * @event
757
- * @param {Diob} pDiob - object that exited
758
- */
759
- onExited(pDiob: Diob): void
760
-
761
- /**
762
- * performs the specified draw function using the specified pArgs object; ex ( {'type': 'image', 'image': this, 'x': 1, 'y': 1} )
763
- * @env Client | Server
764
- * @param {object | object[]} pArgs - an object or array of objects which determines the settings of the draw
765
- */
766
- overScreenDraw(pArgs: object | object[]): void
767
-
768
- /**
769
- * how visible the diob appears; (0 to 1); 0 completely invisible, 1 completely visible, between partially visible, higher the number the more visible
770
- * @env Client | Server
771
- */
772
- alpha: number
773
-
774
- /**
775
- * changes display icon of object
776
- * @env Client | Server
777
- * @param {string} pAtlas - name of atlas icon is in
778
- * @param {string} pIcon - name of icon in pAtlas
779
- */
780
- setIcon(pAtlas: string, pIcon: string): void
781
-
782
- /**
783
- * position on the y-axis of the origin from the top edge of the diob
784
- * @env Client | Server
785
- */
786
- yOrigin: number
787
-
788
- /**
789
- * position of object on the grid y-axis
790
- * @env Client | Server
791
- */
792
- yCoord: number
793
-
794
- /**
795
- * returns an object {'x': xOrigin, 'y': yOrigin} containing the diob's x and y origin offsets
796
- * @env Client | Server
797
- * @returns {object} returns an object {'x': xOrigin, 'y': yOrigin} containing the diob's x and y origin offsets
798
- */
799
- getOrigin(): object
800
-
801
- /**
802
- * when this diob changes icons
803
- * @env Client | Server
804
- * @event
805
- */
806
- onIconUpdate(): void
807
-
808
- /**
809
- * returns an object {'x': x,'y': y} containing the x and y icon offsets
810
- * @env Client | Server
811
- * @returns {object} returns an object {'x': x,'y': y} containing the x and y icon offsets
812
- */
813
- getIconOffsets(): object
814
-
815
- /**
816
- * 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
817
- * @env Client | Server
818
- * @param {Diob} pMask - diob to use as a mask
819
- */
820
- setMask(pMask: Diob): void
821
-
822
- /**
823
- * 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
824
- * @env Client | Server
825
- */
826
- isOverlay: any
827
-
828
- /**
829
- * height to use when calculating y position relayering
830
- * @env Client | Server
831
- */
832
- relayerHeight: any
833
-
834
- /**
835
- * 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]} )
836
- * @env Server
837
- */
838
- preventClientUpdates: any
839
-
840
- /**
841
- * called when a mouse wheel button is scrolled upward while over this object
842
- * @env Client | Server
843
- * @event
844
- * @param {Client} pClient - client of the mouse
845
- * @param {number} pX - the x position of the mouse over the diob
846
- * @param {number} pY - the y position of the mouse over the diob
847
- */
848
- onMouseWheelScrollUp(pClient: Client, pX: number, pY: number): void
849
-
850
- /**
851
- * 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
852
- * @env Client | Server
853
- */
854
- clientSyncData: any
855
-
856
- /**
857
- * 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
858
- * @env Client | Server
859
- * @param {string} pName - name of packet to send
860
- * @param {any} pData - data to be sent; ex {'a': 1, 'b': 2} or 'test'
861
- * @param {Client} [pClient] - 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
862
- */
863
- sendPacket(pName: string, pData: any, pClient?: Client): void
864
-
865
- /**
866
- * returns an object {'x': x, 'y': y} containing the x and y coord offsets of the object
867
- * @env Client | Server
868
- * @returns {object} returns an object {'x': x, 'y': y} containing the x and y coord offsets of the object
869
- */
870
- getCoordOffsets(): object
871
-
872
- /**
873
- * removes all overlays with the pOver type or the exact overlay matching pOver
874
- * @env Client | Server
875
- * @param {string | Diob | Object} pOver - string of the type of object or overlay to remove or actual overlay to remove
876
- * @param {any} [pSave] - optional; if set, the overlay will not be deleted, otherwise this call will delete pOver after removing it from the overlays
877
- */
878
- removeOverlay(pOver: string | Diob | Object, pSave?: any): void
879
-
880
- /**
881
- * called when the mouse exits this object
882
- * @env Client | Server
883
- * @event
884
- * @param {Client} pClient - client of the mouse
885
- * @param {number} pX - the x position of the mouse over the diob
886
- * @param {number} pY - the y position of the mouse over the diob
887
- */
888
- onMouseExit(pClient: Client, pX: number, pY: number): void
889
-
890
- /**
891
- * returns an object {'x': x, 'y': y} containing the x and y positions of the diob on the map
892
- * @env Client | Server
893
- * @returns {{'x': number,'y': number}} returns an object {'x': x, 'y': y} containing the x and y positions of the diob on the map
894
- */
895
- getPos(): {'x': number,'y': number}
896
-
897
- /**
898
- * how many pixels object is offset on the grid x-axis from the xCoord
899
- * @env Client | Server
900
- */
901
- xCoordOffset: number
902
-
903
- /**
904
- * if set, any movable with the same density as this diob may cross over it
905
- * @env Client | Server
906
- */
907
- allowDensityCross: boolean
908
-
909
- /**
910
- * when an object enters the contents of another object
911
- * @env Client | Server
912
- * @event
913
- * @param {Diob} pDiob - object that entered
914
- */
915
- onEntered(pDiob: Diob): void
916
-
917
- /**
918
- * height of the collision box of the object
919
- * @env Client | Server
920
- */
921
- height: number
922
-
923
- /**
924
- * string containing composite value that determines how this diob is drawn with other diobs on the same plane; possible values: normal, add, multiply, screen
925
- * @env Client | Server
926
- */
927
- 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'
928
-
929
- /**
930
- * sets the animation frame to pFrame and freezes for pDelay milliseconds before returning to the previous frame or continuing on if pCont is set
931
- * @env Client | Server
932
- * @param {number} pFrame - frame number
933
- * @param {number} [pDelay] - 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
934
- * @param {boolean} [pCont] - 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
935
- */
936
- setFrame(pFrame: number, pDelay?: number, pCont?: boolean): void
937
-
938
- /**
939
- * 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': ''}
940
- * @env Client | Server
941
- * @param {boolean} [pVal] - optional; string with name of specific value to get; options: 'onFrame', 'frameCount', 'atlasName', 'iconName', 'iconState'
942
- * @returns {object,number} 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': ''}
943
- */
944
- getAnimation(pVal?: boolean): object,number
945
-
946
- /**
947
- * when this diob and pMovable no longer have overlapping bounding boxes
948
- * @env Client | Server
949
- * @event
950
- * @param {Diob} pDiob - diob that uncrossed with this diob
951
- */
952
- onUncrossed(pDiob: Diob): void
953
-
954
- /**
955
- * called when a mouse button has been pressed while over this object
956
- * @env Client | Server
957
- * @event
958
- * @param {Client} pClient - client of the mouse
959
- * @param {number} pX - the x position of the mouse over the diob
960
- * @param {number} pY - the y position of the mouse over the diob
961
- * @param {any} pButton - the button used; 1 for left, 2 for middle, 3 for right
962
- */
963
- onMouseDown(pClient: Client, pX: number, pY: number, pButton: any): void
964
-
965
- /**
966
- * called when the mouse moves after entering this object
967
- * @env Client | Server
968
- * @event
969
- * @param {Client} pClient - client of the mouse
970
- * @param {number} pX - the x position of the mouse over the diob
971
- * @param {number} pY - the y position of the mouse over the diob
972
- */
973
- onMouseMove(pClient: Client, pX: number, pY: number): void
974
-
975
- /**
976
- * returns the coords of the diob with an object {'x': x, 'y': y}
977
- * @env Client | Server
978
- * @returns {object} returns the coords of the diob with an object {'x': x, 'y': y}
979
- */
980
- getCoords(): object
981
-
982
- /**
983
- * CLIENT-ONLY; if set, the client will not update the draw layer of this diob when it changes location on the screen
984
- * @env Client
985
- */
986
- preventScreenRelayer: boolean
987
-
988
- /**
989
- * calls on the client-side when clientSyncData is changed by the server
990
- * @env Client | Server
991
- * @event
992
- * @param {any} pOld - old data in clientSyncData
993
- */
994
- onClientSyncData(pOld: any): void
995
-
996
- /**
997
- * returns an array of locations the diob is on; if diob is a tile, it returns an array containing only itself
998
- * @env Client | Server
999
- * @returns {Diob[]} returns an array of locations the diob is on; if diob is a tile, it returns an array containing only itself
1000
- */
1001
- getLocs(): Diob[]
1002
-
1003
- /**
1004
- * name of the lowest level parent type
1005
- * @env Client | Server
1006
- */
1007
- baseType: string
1008
-
1009
- /**
1010
- * sets the coord offset of the object
1011
- * @env Client | Server
1012
- * @param {number} pX - the x offset from the xCoord
1013
- * @param {number} pY - the y offset from the yCoord
1014
- */
1015
- setCoordOffsets(pX: number, pY: number): void
1016
-
1017
- /**
1018
- * name of object
1019
- * @env Client | Server
1020
- */
1021
- name: any
1022
-
1023
- /**
1024
- * sets the icon state of the diob's icon
1025
- * @env Client | Server
1026
- * @param {string} pState - state of the icon to set
1027
- * @param {number} [pFrame] - optional; if true, animation will start from the frame the last iconState left off on
1028
- */
1029
- setIconState(pState: string, pFrame?: number): void
1030
-
1031
- /**
1032
- * when this diob has an overlay removed from it
1033
- * @env Client | Server
1034
- * @event
1035
- * @param {Diob} pD - the diob that was removed from the overlays
1036
- */
1037
- onRemoveOverlay(pD: Diob): void
1038
-
1039
- /**
1040
- * called when a mouse button is released while over this object
1041
- * @env Client | Server
1042
- * @event
1043
- * @param {Client} pClient - client of the mouse
1044
- * @param {number} pX - the x position of the mouse over the diob
1045
- * @param {number} pY - the y position of the mouse over the diob
1046
- * @param {any} pButton - the button used; 1 for left, 2 for middle, 3 for right
1047
- */
1048
- onMouseUp(pClient: Client, pX: number, pY: number, pButton: any): void
1049
-
1050
- /**
1051
- * position on the x-axis of the origin from the left edge of the diob
1052
- * @env Client | Server
1053
- */
1054
- xOrigin: number
1055
-
1056
- /**
1057
- * 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
1058
- * @env Client | Server
1059
- * @event
1060
- * @param {any} pMovable - movable that is attempting to cross with this diob
1061
- * @param {any} pInit - if set, pMovable initiated the event
1062
- */
1063
- onCross(pMovable: any, pInit: any): void
1064
-
1065
- /**
1066
- * position on the y-axis from top to bottom of the map
1067
- * @env Client | Server
1068
- */
1069
- yPos: number
1070
-
1071
- /**
1072
- * when this diob has an overlay added to it
1073
- * @env Client | Server
1074
- * @event
1075
- * @param {Diob} pD - the diob added as an overlay
1076
- */
1077
- onAddOverlay(pD: Diob): void
1078
-
1079
- /**
1080
- * adds an overlay to the object which is a visual icon that always follows the object; returns the new overlay
1081
- * @env Client | Server
1082
- * @param {string | Diob | Object} pOver - string of the type of object or overlay to add an overlay of or actual diob to get type from
1083
- * @param {number | boolean} [pAppearance] - 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
1084
- * @param {boolean} [pSkipEvent] - optional; if true, the onAddOverlay event will not be called
1085
- * @returns {void} returns the new overlay
1086
- */
1087
- addOverlay(pOver: string | Diob | Object, pAppearance?: number | boolean, pSkipEvent?: boolean): void
1088
-
1089
- /**
1090
- * when this diob enters the client's screen view
1091
- * @env Client | Server
1092
- * @event
1093
- * @param {Client} pClient - a reference to the client
1094
- */
1095
- onScreenShow(pClient: Client): void
1096
-
1097
- /**
1098
- * if set, will share animation with all other diobs with the same sync id; ex {'sync': 'water'}
1099
- * @env Client | Server
1100
- */
1101
- animator: object
1102
-
1103
- /**
1104
- * state of the icon
1105
- * @env Client | Server
1106
- */
1107
- iconState: any
1108
-
1109
- /**
1110
- * return data related to the internal sprite of the diob which
1111
- * @env Client | Server
1112
- * @param {string} pType - the type of data to get 'url' for data url, 'pixels' for array of pixel data, 'canvas' for an HTML canvas element
1113
- */
1114
- getSpriteData(pType: string): void
1115
-
1116
- /**
1117
- * when this diob and pD have overlapping bounding boxes
1118
- * @env Client | Server
1119
- * @event
1120
- * @param {Diob} pD - diob that crossed with this diob
1121
- * @param {any} pInit - if set, pD was relocated and initiated the event
1122
- */
1123
- onCrossed(pD: Diob, pInit: any): void
1124
-
1125
- /**
1126
- * set the diob's sprite to pData
1127
- * @env Client | Server
1128
- * @param {any} pData - the data used as the sprite
1129
- * @param {string} [pType] - optional; default 'url'; the type of data to get 'url' for data url
1130
- */
1131
- setSpriteData(pData: any, pType?: string): void
1132
-
1133
- /**
1134
- * removed pDiob from this diob's viewer array
1135
- * @env Client | Server
1136
- * @param {Diob} pDiob - the diob to remove
1137
- */
1138
- removeInvisibilityViewer(pDiob: Diob): void
1139
-
1140
- /**
1141
- * y-axis offset of the icon
1142
- * @env Client | Server
1143
- */
1144
- yIconOffset: number
1145
-
1146
- /**
1147
- * 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
1148
- * @env Client | Server
1149
- */
1150
- mouseOpacity: any
1151
-
1152
- /**
1153
- * sets the movable's map position to pX, pY
1154
- * @env Client | Server
1155
- * @param {number} pX - value to set the movable's x position on the map to
1156
- * @param {number} pY - value to set the movable's y position on the map to
1157
- * @param {string} [pMap] - optional; string containing name of map to set position on
1158
- */
1159
- setPos(pX: number, pY: number, pMap?: string): void
1160
-
1161
- /**
1162
- * 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
1163
- * @env Client | Server
1164
- * @param {string} [pType] - optional; string containing type path to return
1165
- * @param {boolean} [pChild] - optional; boolean that determines if child types are included
1166
- * @returns {any[]} 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
1167
- */
1168
- getContents(pType?: string, pChild?: boolean): any[]
1169
-
1170
- /**
1171
- * called when the mouse enters this object
1172
- * @env Client | Server
1173
- * @event
1174
- * @param {Client} pClient - client of the mouse
1175
- * @param {number} pX - the x position of the mouse over the diob
1176
- * @param {number} pY - the y position of the mouse over the diob
1177
- */
1178
- onMouseEnter(pClient: Client, pX: number, pY: number): void
1179
-
1180
- /**
1181
- * 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)
1182
- * @env Client | Server
1183
- */
1184
- plane: any
1185
-
1186
- /**
1187
- * x-axis offset of the icon
1188
- * @env Client | Server
1189
- */
1190
- xIconOffset: number
1191
-
1192
- /**
1193
- * returns an array of filter names
1194
- * @env Client | Server
1195
- * @returns {string[]} returns an array of filter names
1196
- */
1197
- getFilters(): string[]
1198
-
1199
- /**
1200
- * name of the map
1201
- * @env Client | Server
1202
- */
1203
- mapName: any
1204
-
1205
- /**
1206
- * sets the x and y icon offsets
1207
- * @env Client | Server
1208
- * @param {number} pX - the x offset of the icon of this object
1209
- * @param {number} pY - the y offset of the icon of this object
1210
- */
1211
- setIconOffsets(pX: number, pY: number): void
1212
-
1213
- /**
1214
- * when a movable bumps into this diob
1215
- * @env Client | Server
1216
- * @event
1217
- * @param {any} pMovable - movable that did the bumping
1218
- */
1219
- onBumped(pMovable: any): void
1220
-
1221
- /**
1222
- * called when a mouse wheel button is scrolled downward while over this object
1223
- * @env Client | Server
1224
- * @event
1225
- * @param {Client} pClient - client of the mouse
1226
- * @param {number} pX - the x position of the mouse over the diob
1227
- * @param {number} pY - the y position of the mouse over the diob
1228
- */
1229
- onMouseWheelScrollDown(pClient: Client, pX: number, pY: number): void
1230
-
1231
- /**
1232
- * 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} )
1233
- * @env Client | Server
1234
- */
1235
- color: string | number[] | {'tint': number}
1236
-
1237
- /**
1238
- * name of the highest level parent type
1239
- * @env Client | Server
1240
- */
1241
- parentType: any
1242
-
1243
- /**
1244
- * width of the collision box of the object
1245
- * @env Client | Server
1246
- */
1247
- width: number
1248
-
1249
- /**
1250
- * 0 for no scale or an object {'x': 2, 'y': 2} containing the information for the scale
1251
- * @env Client | Server
1252
- */
1253
- scale: any
1254
-
1255
- /**
1256
- * how many pixels object is offset on the grid y-axis from its yCoord
1257
- * @env Client | Server
1258
- */
1259
- yCoordOffset: number
1260
-
1261
- /**
1262
- * position on the x-axis from left to right of the map
1263
- * @env Client | Server
1264
- */
1265
- xPos: number
1266
-
1267
- /**
1268
- * order of display of the diob; higher layer objects appear above lower layer objects
1269
- * @env Client | Server
1270
- */
1271
- layer: any
1272
-
1273
- /**
1274
- * 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
1275
- * @env Client | Server
1276
- * @param {string} [pType] - optional; string containing type path to return
1277
- * @param {boolean} [pChild] - optional; boolean that determines if child types are included
1278
- * @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
1279
- */
1280
- getOverlays(pType?: string, pChild?: boolean): Diob[]
1281
-
1282
- /**
1283
- * 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
1284
- * @env Client | Server
1285
- */
1286
- anchor: {'x': number, 'y': number}
1287
-
1288
- }
1289
-
1290
-
1291
- type Movable = {
1292
-
1293
- /**
1294
- * moves movable in the direction of pDir using movable's stepSize until told to stop; takes density into consideration; you can stop movement by calling a different movement function or calling this function with no or null arguments
1295
- * @env Client | Server
1296
- * @param {string} pDir - direction to move movable in
1297
- */
1298
- moveDir(pDir: string): void
1299
-
1300
- /**
1301
- * moves the movable by pX x pixels and pY y pixels until told to stop; takes obstacles into consideration; you can stop movement by calling a different movement function or calling this function with no or null arguments
1302
- * @env Client | Server
1303
- * @param {number} pX - x value to step by
1304
- * @param {number} pY - y value to step by
1305
- */
1306
- movePos(pX: number, pY: number): void
1307
-
1308
- /**
1309
- * true if moving using the built-in movement
1310
- * @env Client | Server
1311
- */
1312
- isMoving: any
1313
-
1314
- /**
1315
- * steps the movable by pX x pixels and pY y pixels; takes obstacles into consideration; returns true or false depending on if the step was successful
1316
- * @env Client | Server
1317
- * @param {number} pX - x value to step by
1318
- * @param {number} pY - y value to step by
1319
- * @param {any} pGlide - if set, movement will not stop unless move directions are blocked
1320
- * @param {any} pSlide - if set, the step will occur without changing the movable's direction
1321
- * @returns {void} returns true or false depending on if the step was successful
1322
- */
1323
- stepPos(pX: number, pY: number, pGlide: any, pSlide: any): void
1324
-
1325
- /**
1326
- * optional; time between each step, default is 60 steps a second for smoothest possible movement (default of 16.6667)
1327
- * @env Client | Server
1328
- */
1329
- moveSettings: any
1330
-
1331
- /**
1332
- * moves movable pSize pixels in the direction of pDir; if pSize is not set, the size is the movable's stepSize; takes obstacles into consideration; returns true or false depending on if the step was successful
1333
- * @env Client | Server
1334
- * @param {string} pDir - direction to move movable in
1335
- * @param {any} pSize - size of step to take
1336
- * @param {any} pSlide - if set, the step will occur without changing the movable's direction
1337
- * @returns {void} returns true or false depending on if the step was successful
1338
- */
1339
- stepDir(pDir: string, pSize: any, pSlide: any): void
1340
-
1341
- /**
1342
- * calls either movable.stepPos or movable.stepDir depending on the specified arguments; if pArg1 is a number, movable.stepPos will be called, otherwise movable.stepDir will be called; returns true or false depending on if the step was successful
1343
- * @env Client | Server
1344
- * @returns {void} returns true or false depending on if the step was successful
1345
- */
1346
- step(): void
1347
-
1348
- /**
1349
- * calls either movable.movePos or movable.moveDir depending on the specified arguments; if pArg1 is a number, movable.movePos will be called, otherwise movable.moveDir will be called; this moves the movable until told to stop; you can stop movement by calling a different movement function or calling this function with no or null arguments
1350
- * @env Client | Server
1351
- */
1352
- move(): void
1353
-
1354
- /**
1355
- * string containing the direction of the movable; 'north', 'south', 'east', 'west', 'northwest', 'northeast', 'southwest', 'southeast'
1356
- * @env Client | Server
1357
- */
1358
- dir: any
1359
-
1360
- }
1361
-
1362
-
1363
- type Particle = {
1364
-
1365
- /**
1366
- * CLIENT-ONLY; if set, the client will not update the draw layer of this diob when it changes location on the screen
1367
- * @env Client
1368
- */
1369
- preventScreenRelayer: boolean
1370
-
1371
- }
1372
-
1373
-
1374
- type Tile = {
1375
-
1376
- /**
1377
- * when an object exits the contents of another object
1378
- * @env Client | Server
1379
- * @event
1380
- * @param {Diob} pDiob - object that exited
1381
- */
1382
- onExited(pDiob: Diob): void
1383
-
1384
- /**
1385
- * called before the diob enters the tile; returning false will prevent the diob from entering
1386
- * @env Client | Server
1387
- * @event
1388
- * @param {Diob} pDiob - diob trying to enter this tile
1389
- * @param {string} pDir - direction of movement diob is attempting to make to enter the tile
1390
- */
1391
- onEnter(pDiob: Diob, pDir: string): void
1392
-
1393
- /**
1394
- * when an object enters the contents of another object
1395
- * @env Client | Server
1396
- * @event
1397
- * @param {Diob} pDiob - object that entered
1398
- */
1399
- onEntered(pDiob: Diob): void
1400
-
1401
- /**
1402
- * called before the diob exits the tile; returning false will prevent the diob from exiting
1403
- * @env Client | Server
1404
- * @event
1405
- * @param {Diob} pDiob - diob trying to exit this tile
1406
- * @param {string} pDir - direction of movement diob is attempting to make to exit the tile
1407
- */
1408
- onExit(pDiob: Diob, pDir: string): void
1409
-
1410
- }
1411
-
1412
-
1413
- type Region = {
1414
-
1415
- /**
1416
- * when an object exits the contents of another object
1417
- * @env Client | Server
1418
- * @event
1419
- * @param {Diob} pDiob - object that exited
1420
- */
1421
- onExited(pDiob: Diob): void
1422
-
1423
- /**
1424
- * when an object enters the contents of another object
1425
- * @env Client | Server
1426
- * @event
1427
- * @param {Diob} pDiob - object that entered
1428
- */
1429
- onEntered(pDiob: Diob): void
1430
-
1431
- }
1432
-
1433
-
1434
- type Mob = {
1435
-
1436
- /**
1437
- * a reference to the client of this mob
1438
- * @env Client | Server
1439
- */
1440
- client: Client
1441
-
1442
- /**
1443
- * when a client no longer has control of a mob
1444
- * @env Client | Server
1445
- * @event
1446
- */
1447
- onLogout(): void
1448
-
1449
- /**
1450
- * when a client has taken control of the mob
1451
- * @env Client | Server
1452
- * @event
1453
- */
1454
- onLogin(): void
1455
-
1456
- }
1457
-
1458
-
1459
- type Overlay = {
1460
-
1461
- /**
1462
- * if true, this overlay will appear directly above the parent and use the same appearance properties as the parent, such as angle and alpha; the overlay will basically be an extension of the parent's icon; instead of true this can be an object containing information on the appearMask, 'shareIcon' to have the overlay share the same iconName as the parent, 'isUnder' to make the overlay appear under the parent instead of above, and 'ownMod' to let the overlay use its own alpha, angle, scale, transform, and composite variables, 'ownState' to have this overlay not sync up with the parent's iconState; ex {'shareIcon': true, 'isUnder': true}
1463
- * @env Client | Server
1464
- */
1465
- appearMask: any
1466
-
1467
- }
1468
-
1469
-
1470
- type Sound = {
1471
-
1472
- /**
1473
- * number of seconds that have been played into the sound
1474
- * @env Client | Server
1475
- */
1476
- currentTime: number
1477
-
1478
- /**
1479
- * fades the sound's volume in or out from the current volume to pVol over pDur seconds
1480
- * @env Client | Server
1481
- * @param {number} pVol - number between 0 and 100
1482
- * @param {number} pDur - number of seconds
1483
- */
1484
- fade(pVol: number, pDur: number): void
1485
-
1486
- /**
1487
- * if true, the sound has been manually stopped
1488
- * @env Client | Server
1489
- */
1490
- isStopped: boolean
1491
-
1492
- /**
1493
- * resume the sound
1494
- * @env Client | Server
1495
- */
1496
- resume(): void
1497
-
1498
- /**
1499
- * sets the volume of this Sound
1500
- * @env Client | Server
1501
- * @param {number} pVol - number between 0 and 100
1502
- */
1503
- setVolume(pVol: number): void
1504
-
1505
- /**
1506
- * stop the sound
1507
- * @env Client | Server
1508
- */
1509
- stop(): void
1510
-
1511
- /**
1512
- * called when the sound finishes playing
1513
- * @env Client | Server
1514
- * @event
1515
- */
1516
- onEnded(): void
1517
-
1518
- /**
1519
- * number of seconds to play the sound for up to the sound file duration
1520
- * @env Client | Server
1521
- */
1522
- duration: number
1523
-
1524
- /**
1525
- * called when the sound starts to playing for the first time
1526
- * @env Client | Server
1527
- * @event
1528
- */
1529
- onStarted(): void
1530
-
1531
- /**
1532
- * returns an ArrayBuffer containing the raw sound data; soundName must already be loaded before calling this
1533
- * @env Client | Server
1534
- * @returns {ArrayBuffer} returns an ArrayBuffer containing the raw sound data; soundName must already be loaded before calling this
1535
- */
1536
- getRawData(): ArrayBuffer
1537
-
1538
- /**
1539
- * called when the sound is manually resumed
1540
- * @env Client | Server
1541
- * @event
1542
- */
1543
- onResumed(): void
1544
-
1545
- /**
1546
- * returns an AudioBuffer containing the useful data on the sound's buffer; the sound must already be loaded and playing
1547
- * @env Client | Server
1548
- * @returns {AudioBuffer} returns an AudioBuffer containing the useful data on the sound's buffer; the sound must already be loaded and playing
1549
- */
1550
- getBuffer(): AudioBuffer
1551
-
1552
- /**
1553
- * name of the sound file associated with this sound object
1554
- * @env Client | Server
1555
- */
1556
- soundName: string
1557
-
1558
- /**
1559
- * number of seconds to start playing the sound at
1560
- * @env Client | Server
1561
- */
1562
- startTime: number
1563
-
1564
- /**
1565
- * turns looping on or off; if pLoop is not set, loop will be toggled
1566
- * @env Client | Server
1567
- * @param {any} [pLoop] - optional; true to loop, false to stop loop
1568
- */
1569
- setLoop(pLoop?: any): void
1570
-
1571
- /**
1572
- * number between 0 and 100; volume of this sound object; default 100
1573
- * @env Client | Server
1574
- */
1575
- volume: number
1576
-
1577
- /**
1578
- * returns an AudioContext containing the useful data on the sound's context; the sound must already be loaded and playing
1579
- * @env Client | Server
1580
- * @returns {AudioContext} returns an AudioContext containing the useful data on the sound's context; the sound must already be loaded and playing
1581
- */
1582
- getContext(): AudioContext
1583
-
1584
- /**
1585
- * called when the sound is manually stopped
1586
- * @env Client | Server
1587
- * @event
1588
- */
1589
- onStopped(): void
1590
-
1591
- /**
1592
- * if true sound loops; if false sound plays once
1593
- * @env Client | Server
1594
- */
1595
- loop: boolean
1596
-
1597
- }
1598
-
1599
-
1600
- type Interface = {
1601
-
1602
- /**
1603
- * shows the interface element
1604
- * @env Client | Server
1605
- */
1606
- show(): void
1607
-
1608
- /**
1609
- * default false; if set this interface will not scale or move when the window changes size
1610
- * @env Client | Server
1611
- */
1612
- preventAutoScale: boolean
1613
-
1614
- /**
1615
- * returns the name of the interface the interface object is part of
1616
- * @env Client | Server
1617
- * @returns {string} returns the name of the interface the interface object is part of
1618
- */
1619
- getInterfaceName(): string
1620
-
1621
- /**
1622
- * default 0; number of pixels to offset the text by on the y-axis
1623
- * @env Client | Server
1624
- */
1625
- textStyle: object
1626
-
1627
- /**
1628
- * executes any default commands or custom executed event of object
1629
- * @env Client | Server
1630
- * @param {Client} pClient - client to execute with
1631
- */
1632
- execute(pClient: Client): void
1633
-
1634
- /**
1635
- * returns an object {'x': x,'y': y} containing the x and y positions of the interface element on the screen
1636
- * @env Client | Server
1637
- * @returns {{'x': number,'y': number}} returns an object {'x': x,'y': y} containing the x and y positions of the interface element on the screen
1638
- */
1639
- getPos(): {'x': number,'y': number}
1640
-
1641
- /**
1642
- * string containing composite value that determines how this diob is drawn with other diobs on the same plane; possible values: 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
1643
- * @env Client | Server
1644
- */
1645
- 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'
1646
-
1647
- /**
1648
- * returns the client this interface element belongs to, if there is one
1649
- * @env Client | Server
1650
- * @returns {void} returns the client this interface element belongs to, if there is one
1651
- */
1652
- getClient(): void
1653
-
1654
- /**
1655
- * position on the y-axis from top to bottom of the interface element on the screen
1656
- * @env Client | Server
1657
- */
1658
- yPos: number
1659
-
1660
- /**
1661
- * locks the interface element to an edge of the screen; only works if preventAutoScale is enabled; possible values: top, top-left, top-right, right, left, bottom, bottom-right, bottom-left
1662
- * @env Client | Server
1663
- */
1664
- edgeLock: 'top' | 'top-left' | 'top-right' | 'right' | 'left' | 'bottom' | 'bottom-right' | 'bottom-left'
1665
-
1666
- /**
1667
- * type of interface; TextBox/CommandInput/TextInput/PassInput/WebBox/TextArea/Default
1668
- * @env Client | Server
1669
- */
1670
- interfaceType: string
1671
-
1672
- /**
1673
- * moves the interface element to the specified screen location
1674
- * @env Client | Server
1675
- * @param {number} pX - position on the x-axis of the screen; from left to right
1676
- * @param {number} pY - position on the y-axis of the screen; from top to bottom
1677
- */
1678
- setPos(pX: number, pY: number): void
1679
-
1680
- /**
1681
- * true if the interface is hidden; false otherwise
1682
- * @env Client | Server
1683
- */
1684
- isHidden: boolean
1685
-
1686
- /**
1687
- * returns the DOM/HTML element attached to this interface element, if there is one; access `innerBox` to get the box that `text` is added to
1688
- * @env Client | Server
1689
- * @returns {void} returns the DOM/HTML element attached to this interface element, if there is one; access `innerBox` to get the box that `text` is added to
1690
- */
1691
- getDOM(): void
1692
-
1693
- /**
1694
- * hides the interface element
1695
- * @env Client | Server
1696
- */
1697
- hide(): void
1698
-
1699
- /**
1700
- * position on the x-axis from left to right of the interface element on the screen
1701
- * @env Client | Server
1702
- */
1703
- xPos: number
1704
-
1705
- }
1706
-
1707
-
1708
- type Client = {
1709
-
1710
- /**
1711
- * 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)
1712
- * @env Client | Server
1713
- * @param {any} pKey - key used to reference the stored data
1714
- * @param {any} pData - data as a string to store locally for the client
1715
- */
1716
- setLocalStorage(pKey: any, pData: any): void
1717
-
1718
- /**
1719
- * 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
1720
- * @env Client | Server
1721
- * @param {number} pX - x position on the screen
1722
- * @param {number} pY - y position on the screen
1723
- * @param {object} [pO] - optional; an existing object to set the x and y of
1724
- * @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
1725
- */
1726
- getPosFromScreen(pX: number, pY: number, pO?: object): {'x': number, 'y': number}
1727
-
1728
- /**
1729
- * returns the interface element object of the specified interface
1730
- * @env Client | Server
1731
- * @param {string} pInterface - name of the interface to get element from
1732
- * @param {Diob} pElement - name of the element to get
1733
- * @returns {Diob} returns the interface element object of the specified interface
1734
- */
1735
- getInterfaceElement(pInterface: string, pElement: Diob): Diob
1736
-
1737
- /**
1738
- * removes the specified filter
1739
- * @env Client | Server
1740
- * @param {string} pName - name of filter to remove
1741
- */
1742
- removeFilter(pName: string): void
1743
-
1744
- /**
1745
- * sets the client's overlays to the array pOver
1746
- * @env Client | Server
1747
- * @param {Diob[]} pOver - array of overlays to set this client's overlays to
1748
- */
1749
- setOverlays(pOver: Diob[]): void
1750
-
1751
- /**
1752
- * brings up a confirm window asking the user to select "yes" or "no"; returns true or false
1753
- * @env Client | Server
1754
- * @param {string} pMes - message to display in the confirm window
1755
- * @param {Function} pFunc - 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] )
1756
- * @returns {void} returns true or false
1757
- */
1758
- confirm(pMes: string, pFunc: Function): void
1759
-
1760
- /**
1761
- * amount of blank tiles that can be seen on the left and right of the view
1762
- * @env Client | Server
1763
- */
1764
- xEdgeLimit: number
1765
-
1766
- /**
1767
- * performs the specified draw function using the specified pArgs object; ex ( {'type': 'image', 'image': this, 'x': 1, 'y': 1} )
1768
- * @env Client | Server
1769
- * @param {object | object[]} pArgs - an object or array of objects which determines the settings of the draw
1770
- * @param {string} pName - type of draw
1771
- */
1772
- topScreenDraw(pArgs: object | object[], pName: string): void
1773
-
1774
- /**
1775
- * returns an object {'x': x, 'y': y} containing the x and y offsets of client's view eye
1776
- * @env Client | Server
1777
- * @returns {{'x': number, 'y': number}} returns an object {'x': x, 'y': y} containing the x and y offsets of client's view eye
1778
- */
1779
- getViewEyeOffsets(): {'x': number, 'y': number}
1780
-
1781
- /**
1782
- * creates a new top screen named pName with the layer pLayer
1783
- * @env Client | Server
1784
- * @param {string} pName - name of the top screen to create
1785
- * @param {any} [pLayer] - optional; layer to give the screen
1786
- * @param {object} [pSet] - optional; settings object; ex ( {'scaleType': 'nearest'} );
1787
- */
1788
- createTopScreen(pName: string, pLayer?: any, pSet?: object): void
1789
-
1790
- /**
1791
- * returns an object containing the x and y of the game scale; ex: {'x': 2, 'y': 2}
1792
- * @env Client | Server
1793
- * @param {object} [pO] - optional; an existing object to set the x and y of
1794
- * @returns {{'x': number, 'y': number}} returns an object containing the x and y of the game scale; ex: {'x': 2, 'y': 2}
1795
- */
1796
- getScreenScale(pO?: object): {'x': number, 'y': number}
1797
-
1798
- /**
1799
- * ends movement of client.playerMob in the direction of pDir
1800
- * @env Client | Server
1801
- * @param {string} pDir - name of direction to stop moving the client's playerMob in; pDir being undefined ends all movement
1802
- */
1803
- endMove(pDir: string): void
1804
-
1805
- /**
1806
- * returns the name of the account the client is logged in with
1807
- * @env Client | Server
1808
- * @returns {string} returns the name of the account the client is logged in with
1809
- */
1810
- getAccountName(): string
1811
-
1812
- /**
1813
- * adds the specified filter
1814
- * @env Client | Server
1815
- * @param {string} pName - name of the filter; only one name may be used at a time, using the name will remove the old filter with that name
1816
- * @param {string} pType - the type of filter to add; below is the types and their specific possible pArgs values
1817
- * @param {any} pArgs - color-based filter
1818
- */
1819
- addFilter(pName: string, pType: string, pArgs: any): void
1820
-
1821
- /**
1822
- * removes the client command from the client's commands
1823
- * @env Client | Server
1824
- * @param {string} pCommand - name of the client command to remove
1825
- */
1826
- removeCommand(pCommand: string): void
1827
-
1828
- /**
1829
- * sets the background of the client's screen background
1830
- * @env Client | Server
1831
- * @param {string} pBack - string containing a color, for example '#000' for black
1832
- */
1833
- setScreenBackground(pBack: string): void
1834
-
1835
- /**
1836
- * sets the client's max FPS to pFPS
1837
- * @env Client | Server
1838
- * @param {any} pFPS - cap the amount the FPS the client will try to reach when drawing the screen; default 60
1839
- */
1840
- setMaxFPS(pFPS: any): void
1841
-
1842
- /**
1843
- * returns a reference to the web tag with the id pID
1844
- * @env Client | Server
1845
- * @param {string} pID - id of the web tag
1846
- * @returns {HTMLElement} returns a reference to the web tag with the id pID
1847
- */
1848
- getWebTag(pID: string): HTMLElement
1849
-
1850
- /**
1851
- * sets the style of pStyle to the value of pValue of the web tag with the id pID
1852
- * @env Client | Server
1853
- * @param {string} pID - id of the web tag to set the style of
1854
- * @param {any} pStyle - type of style to set
1855
- * @param {string} pValue - value as a string to set the style to
1856
- */
1857
- setWebTagStyle(pID: string, pStyle: any, pValue: string): void
1858
-
1859
- /**
1860
- * sets the HTML of the web box behind the game screen
1861
- * @env Client | Server
1862
- * @param {string} pBack - string containing HTML to set use in the web box behind the game screen
1863
- */
1864
- setWebBackground(pBack: string): void
1865
-
1866
- /**
1867
- * 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
1868
- * @env Client | Server
1869
- */
1870
- clearKeyDownEvents(): void
1871
-
1872
- /**
1873
- * focuses on the interface element object
1874
- * @env Client | Server
1875
- */
1876
- setFocus(): void
1877
-
1878
- /**
1879
- * sets the variable pVar to pVal for the plane pPlane
1880
- * @env Client | Server
1881
- * @param {number} pPlane - value of plane to set
1882
- * @param {string} pVar - string containing name of variable to set
1883
- * @param {boolean} pVal - value to give this plane's pVar variable
1884
- */
1885
- setPlane(pPlane: number, pVar: string, pVal: boolean): void
1886
-
1887
- /**
1888
- * sets the client's view eye offsets
1889
- * @env Client | Server
1890
- * @param {number} pX - amount of pixels for the screen to be offset from the client's view eye on the x-axis
1891
- * @param {number} pY - amount of pixels for the screen to be offset from the client's view eye on the y-axis
1892
- */
1893
- setViewEyeOffsets(pX: number, pY: number): void
1894
-
1895
- /**
1896
- * plays a sound to this client; returns the Sound object
1897
- * @env Client | Server
1898
- * @param {string | {'soundName': string, 'volume': number}} pSound - 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} )
1899
- * @param {any} [pStart] - optional; time to start playing the sound at
1900
- * @param {any} [pDuration] - optional; how long to play the sound for
1901
- * @returns {void} returns the Sound object
1902
- */
1903
- playSound(pSound: string | {'soundName': string, 'volume': number}, pStart?: any, pDuration?: any): void
1904
-
1905
- /**
1906
- * gets the data as a string that is stored with the key pKey on the client's computer
1907
- * @env Client | Server
1908
- * @param {any} pKey - key used to get data stored locally on the client's computer
1909
- */
1910
- getLocalStorage(pKey: any): Storage
1911
-
1912
- /**
1913
- * executes the event pEvent of the web tag with the id pID
1914
- * @env Client | Server
1915
- * @param {string} pID - id of the web tag to call the event of
1916
- * @param {any} pEvent - name of the event to call; onMouseDown, onMouseUp, onMouseClick, onMouseDblClick, onMouseMove
1917
- */
1918
- callWebTagEvent(pID: string, pEvent: any): void
1919
-
1920
- /**
1921
- * returns an array of names of all created interfaces
1922
- * @env Client | Server
1923
- * @returns {string[]} returns an array of names of all created interfaces
1924
- */
1925
- getInterfaceNames(): string[]
1926
-
1927
- /**
1928
- * removes the script with the pName name from the game
1929
- * @env Client | Server
1930
- * @param {string} pName - name of script to remove
1931
- */
1932
- removeWebScript(pName: string): void
1933
-
1934
- /**
1935
- * loads a JavaScript file into the project
1936
- * @env Client | Server
1937
- * @param {string} pName - name to give the script
1938
- * @param {any} pLink - link to the JavaScript file to load
1939
- * @param {any} [pModule] - optional; load script as a module
1940
- * @param {Function} [pFunc] - optional; function to call after the JavaScript file has loaded
1941
- */
1942
- addWebScript(pName: string, pLink: any, pModule?: any, pFunc?: Function): void
1943
-
1944
- /**
1945
- * a string containing the HTML to display behind the game screen; #web_background to set the style of the entire background
1946
- * @env Client | Server
1947
- */
1948
- webBackground: string
1949
-
1950
- /**
1951
- * sets the client's screenView to pView or default if pView is null
1952
- * @env Client | Server
1953
- * @param {object} pView - 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
1954
- */
1955
- setScreenView(pView: object): void
1956
-
1957
- /**
1958
- * returns an object containing the cursor information; ex ( {'cursor': 'default', 'x': 0, 'y': 0} )
1959
- * @env Client | Server
1960
- * @returns {{'cursor': string, 'x': number, 'y': number}} returns an object containing the cursor information; ex ( {'cursor': 'default', 'x': 0, 'y': 0} )
1961
- */
1962
- getMouseCursor(): {'cursor': string, 'x': number, 'y': number}
1963
-
1964
- /**
1965
- * 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
1966
- * @env Client | Server
1967
- * @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
1968
- */
1969
- getScreenView(): object
1970
-
1971
- /**
1972
- * calls the client command of pCommand with the arguments of pArgs
1973
- * @env Client
1974
- * @param {string} pCommand - name of the client command to call
1975
- * @param {any[]} pArgs - array of arguments to pass to the command
1976
- * @param {any} [pSend] - CLIENT-ONLY; optional; if set the command will also be sent to the server
1977
- */
1978
- callCommand(pCommand: string, pArgs: any[], pSend?: any): void
1979
-
1980
- /**
1981
- * name of the interface element to send default messages to (ex: 'interface1.output1' )
1982
- * @env Client | Server
1983
- */
1984
- mainOutput: string
1985
-
1986
- /**
1987
- * sets the focus on the web tag with the id pID
1988
- * @env Client | Server
1989
- * @param {string} pID - id of the web tag to set focus to
1990
- */
1991
- setWebTagFocus(pID: string): void
1992
-
1993
- /**
1994
- * hides the interface of pInterface if pElement is not specified, otherwise it only hides pElement
1995
- * @env Client | Server
1996
- * @param {string} pInterface - name of the interface to hide or the interface containing pElement
1997
- * @param {Diob} [pElement] - optional; name of interface lement in pInterface to hide
1998
- */
1999
- hideInterface(pInterface: string, pElement?: Diob): void
2000
-
2001
- /**
2002
- * 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
2003
- * @env Client | Server
2004
- * @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
2005
- */
2006
- getMapView(): object
2007
-
2008
- /**
2009
- * toggles load screen on and off
2010
- * @env Client | Server
2011
- * @param {boolean} [pVal] - optional; true to show load screen, false to hide load screen
2012
- */
2013
- toggleLoadScreen(pVal?: boolean): void
2014
-
2015
- /**
2016
- * toggles macro capturing on and off
2017
- * @env Client | Server
2018
- * @param {boolean} [pVal] - optional; true to resume capturing macros, false to pause capturing macros
2019
- */
2020
- toggleMacroCapture(pVal?: boolean): void
2021
-
2022
- /**
2023
- * removes a web tag with the id of pID from the client's screen
2024
- * @env Client | Server
2025
- * @param {string} pID - id of the web tag to remove from the client's screen
2026
- */
2027
- removeWebTag(pID: string): void
2028
-
2029
- /**
2030
- * sets the view eye of the client to be centered on pDiob; the default is the player mob
2031
- * @env Client | Server
2032
- * @param {Diob} pDiob - diob to have the client's screen view centered on
2033
- */
2034
- setViewEye(pDiob: Diob): void
2035
-
2036
- /**
2037
- * returns an object containing the width and height of the game window; ex: {'width': 100, 'height': 100}
2038
- * @env Client | Server
2039
- * @param {object} [pO] - optional; an existing object to set the width and height of
2040
- * @returns {{'width': number, 'height': number}} returns an object containing the width and height of the game window; ex: {'width': 100, 'height': 100}
2041
- */
2042
- getWindowSize(pO?: object): {'width': number, 'height': number}
2043
-
2044
- /**
2045
- * 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
2046
- * @env Server
2047
- */
2048
- preventServerInterfaces: boolean
2049
-
2050
- /**
2051
- * 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
2052
- * @env Client | Server
2053
- * @param {string} pCommand - name of the client command to be added
2054
- * @param {Function} pFunc - function to be called when the command is executed
2055
- */
2056
- addCommand(pCommand: string, pFunc: Function): void
2057
-
2058
- /**
2059
- * sets the client's mainOutput
2060
- * @env Client | Server
2061
- * @param {string} pOutput - name of the interface element to send default messages to (ex: 'interface1.output1' )
2062
- */
2063
- setMainOutput(pOutput: string): void
2064
-
2065
- /**
2066
- * 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
2067
- * @env Client | Server
2068
- * @param {string} pName - name of the custom macro
2069
- * @param {string} pKey - string of key that will execute the macro
2070
- * @param {string} [pDown] - 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'
2071
- * @param {string} [pUp] - 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'
2072
- */
2073
- addCustomMacro(pName: string, pKey: string, pDown?: string, pUp?: string): void
2074
-
2075
- /**
2076
- * 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'}
2077
- * @env Client | Server
2078
- * @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'}
2079
- */
2080
- getNavigator(): Navigator
2081
-
2082
- /**
2083
- * true or false; true acts the same as 'scaleNearest' when scaling, but it also removes smoothing caused by other things
2084
- * @env Client | Server
2085
- */
2086
- screenView: any
2087
-
2088
- /**
2089
- * 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
2090
- * @env Client | Server
2091
- * @param {string} pInterface - name of interface to show
2092
- * @param {Diob} [pElement] - optional; name of interface element in pInterface to show
2093
- * @param {boolean} [pForce] - optional; if set, all hidden elements will be forced to be shown
2094
- */
2095
- showInterface(pInterface: string, pElement?: Diob, pForce?: boolean): void
2096
-
2097
- /**
2098
- * moves the client.playerMob in the direction pDir until told to stop via endMove(pDir)
2099
- * @env Client | Server
2100
- * @param {string} pDir - name of direction to move client.playerMob
2101
- */
2102
- startMove(pDir: string): void
2103
-
2104
- /**
2105
- * 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)
2106
- * @env Client | Server
2107
- */
2108
- address: string
2109
-
2110
- /**
2111
- * 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'
2112
- * @env Client | Server
2113
- */
2114
- mainWebStyle: string
2115
-
2116
- /**
2117
- * returns the canvas element that this element is drawn on to
2118
- * @env Client | Server
2119
- * @param {any} pInt - name of the interface that element is on
2120
- * @param {any} pEl - name of the element
2121
- * @returns {HTMLCanvasElement} returns the canvas element that this element is drawn on to
2122
- */
2123
- getInterfaceCanvas(pInt: any, pEl: any): HTMLCanvasElement
2124
-
2125
- /**
2126
- * adds a custom font
2127
- * @env Client | Server
2128
- * @param {string} pName - name of the font
2129
- * @param {string} pPath - url or path to the font file
2130
- * @param {any} [pRemote] - optional; set this if the path is outside of the project
2131
- * @param {object} [pStyle] - optional; custom style object to apply to the font; ex {'font-weight': bold}
2132
- */
2133
- addCustomFont(pName: string, pPath: string, pRemote?: any, pStyle?: object): void
2134
-
2135
- /**
2136
- * 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
2137
- * @env Client | Server
2138
- * @param {string} pName - name of packet to send
2139
- * @param {any} pData - an object containing data to be sent; ex {'a': 1, 'b': 2}
2140
- * @param {boolean} [pForce] - optional; send the packet immediately instead of buffering it with the packet delay
2141
- */
2142
- sendPacket(pName: string, pData: any, pForce?: boolean): void
2143
-
2144
- /**
2145
- * toggles screen drawing on and off
2146
- * @env Client | Server
2147
- * @param {boolean} [pVal] - optional; true to resume screen drawing, false to pause all screen drawing, 'map' to pause only the map drawing
2148
- */
2149
- toggleScreenDrawing(pVal?: boolean): void
2150
-
2151
- /**
2152
- * removes all overlays with the pOver type or the exact overlay matching pOver
2153
- * @env Client | Server
2154
- * @param {string | Diob | Object} pOver - string of the type of object or overlay to remove or actual overlay to remove
2155
- */
2156
- removeOverlay(pOver: string | Diob | Object): void
2157
-
2158
- /**
2159
- * adds an interface element to the interface and returns it
2160
- * @env Client | Server
2161
- * @param {string} pType - type of interface object to add
2162
- * @param {string} pInterface - name of the interface to add the interface element to
2163
- * @param {string} [pName] - optional; name to give the element being added
2164
- * @param {number} [pX] - optional; x position to give the element
2165
- * @param {number} [pY] - optional; y position to the give the element
2166
- * @param {any[]} [pArgs] - optional; array of arguments to pass to the onNew event of the interface element being created
2167
- * @returns {Diob} returns it
2168
- */
2169
- addInterfaceElement(pType: string, pInterface: string, pName?: string, pX?: number, pY?: number, pArgs?: any[]): Diob
2170
-
2171
- /**
2172
- * sets the content of the web tag with the id pID to the value of pContent
2173
- * @env Client | Server
2174
- * @param {string} pID - id of the web tag to set the content of
2175
- * @param {string} pContent - string containing the content to change the web tag's content to
2176
- */
2177
- setWebTagContent(pID: string, pContent: string): void
2178
-
2179
- /**
2180
- * amount of pixels the client's view is offset by from the view eye on the y-axis
2181
- * @env Client | Server
2182
- */
2183
- yViewEyeOffset: number
2184
-
2185
- /**
2186
- * a reference to the player mob of this client
2187
- * @env Client | Server
2188
- */
2189
- mob: Diob
2190
-
2191
- /**
2192
- * brings up an alert window with pMes in it
2193
- * @env Client | Server
2194
- * @param {string} pMes - message to show in the alert
2195
- */
2196
- alert(pMes: string): void
2197
-
2198
- /**
2199
- * returns the current FPS
2200
- * @env Client | Server
2201
- * @returns {number} returns the current FPS
2202
- */
2203
- getFPS(): number
2204
-
2205
- /**
2206
- * 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
2207
- * @env Client | Server
2208
- */
2209
- inInput: boolean
2210
-
2211
- /**
2212
- * returns the diob the client's screen eye is currently set to
2213
- * @env Client | Server
2214
- * @returns {Diob} returns the diob the client's screen eye is currently set to
2215
- */
2216
- getViewEye(): Diob
2217
-
2218
- /**
2219
- * moves the client to a new server located at the address pAddress
2220
- * @env Client | Server
2221
- * @param {any} pAddres - address for the server to move the client to; example '127.0.0.1:1234'
2222
- */
2223
- changeServer(pAddres: any): void
2224
-
2225
- /**
2226
- * 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
2227
- * @env Client | Server
2228
- * @param {string} pInterface - name of the interface to get element from
2229
- * @param {string} [pType] - optional; string containing type path to return
2230
- * @param {boolean} [pChild] - optional; boolean that determines if child types are included
2231
- * @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
2232
- */
2233
- getInterfaceElements(pInterface: string, pType?: string, pChild?: boolean): Diob[]
2234
-
2235
- /**
2236
- * returns the content of the web tag with the id of pID
2237
- * @env Client | Server
2238
- * @param {string} pID - id of the web tag to get the content of
2239
- * @returns {string} returns the content of the web tag with the id of pID
2240
- */
2241
- getWebTagContent(pID: string): string
2242
-
2243
- /**
2244
- * changes the name and layer of the top screen with the name pName; adding data optional
2245
- * @env Client | Server
2246
- * @param {string} pName - name of the top screen to set
2247
- * @param {any} pNewName - new name of the top screen
2248
- * @param {any} pNewLayer - new layer of the top screen
2249
- * @param {any} [pNewData] - optional; data to add to the screen
2250
- * @param {any} [pNewSet] - optional; new settings object
2251
- */
2252
- setTopScreen(pName: string, pNewName: any, pNewLayer: any, pNewData?: any, pNewSet?: any): void
2253
-
2254
- /**
2255
- * sets the edge limit of the map for the client
2256
- * @env Client | Server
2257
- * @param {number} pX - number of black tiles visible on the left and right edges of the map; -1 for default
2258
- * @param {number} pY - number of black tiles visible on the top and bottom edges of the map; -1 for default
2259
- */
2260
- setEdgeLimit(pX: number, pY: number): void
2261
-
2262
- /**
2263
- * sets the client's mapView to pView or default if pView is null
2264
- * @env Client | Server
2265
- * @param {object} pView - 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
2266
- */
2267
- setMapView(pView: object): void
2268
-
2269
- /**
2270
- * brings up a prompt window to ask for text from the user
2271
- * @env Client | Server
2272
- * @param {any} pTitle - title of the prompt
2273
- * @param {string} pMes - default text in the input
2274
- * @param {Function} pFunc - 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] )
2275
- */
2276
- prompt(pTitle: any, pMes: string, pFunc: Function): void
2277
-
2278
- /**
2279
- * amount of pixels the client's view is offset by from the view eye on the x-axis
2280
- * @env Client | Server
2281
- */
2282
- xViewEyeOffset: number
2283
-
2284
- /**
2285
- * returns true if pInt is currently shown, false if not; if pEl is set, checks if the specified element is shown
2286
- * @env Client | Server
2287
- * @param {any} pInt - name of the interface
2288
- * @param {any} [pEl] - optional; name of the element
2289
- * @returns {boolean} returns true if pInt is currently shown, false if not; if pEl is set, checks if the specified element is shown
2290
- */
2291
- checkInterfaceShown(pInt: any, pEl?: any): boolean
2292
-
2293
- /**
2294
- * outputs text to an interface element; if pInt or pEl is not set or is invalid, text goes to client.mainOutput
2295
- * @env Client | Server
2296
- * @param {string} pText - text to be displayed
2297
- * @param {string} pInt - string containing interface file name to output to
2298
- * @param {string} pEl - string containing the interface element name to output to
2299
- */
2300
- outputText(pText: string, pInt: string, pEl: string): void
2301
-
2302
- /**
2303
- * 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
2304
- * @env Client | Server
2305
- * @param {number} pX - starting x position
2306
- * @param {number} pY - starting y position
2307
- * @param {string} [pType] - optional; ending x position
2308
- * @param {boolean} [pChild] - optional; ending y position
2309
- * @param {string} [pPage] - optional; string containing type path to return
2310
- * @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
2311
- */
2312
- getInterfaceElementsFromScreen(pX: number, pY: number, pType?: string, pChild?: boolean, pPage?: string): Diob[]
2313
-
2314
- /**
2315
- * removes a font from being usable
2316
- * @env Client | Server
2317
- * @param {string} pName - name of the font to remove
2318
- */
2319
- removeCustomFont(pName: string): void
2320
-
2321
- /**
2322
- * string containing a color (null for transparent) to set the client's screen background to, for example '#000' for black; default is '#000'
2323
- * @env Client | Server
2324
- */
2325
- screenBackground: string | null
2326
-
2327
- /**
2328
- * 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
2329
- * @env Client | Server
2330
- * @param {string | Diob | Object} pOver - string of the type of object or overlay to add an overlay of or actual diob to add
2331
- * @param {number | boolean} [pAppearance] - 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}
2332
- * @param {boolean} [pSkipEvent] - optional; if true, the onAddOverlay event will not be called
2333
- * @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
2334
- */
2335
- addOverlay(pOver: string | Diob | Object, pAppearance?: number | boolean, pSkipEvent?: boolean): Diob
2336
-
2337
- /**
2338
- * changes the macro file the client uses
2339
- * @env Client | Server
2340
- * @param {string} pMacro - name of macro file to set client macros to
2341
- */
2342
- setMacroAtlas(pMacro: string): void
2343
-
2344
- /**
2345
- * 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': ''}
2346
- * @env Client | Server
2347
- * @param {string} [pName] - optional; name of the top screen to get the data of
2348
- * @param {string} [pType] - optional; type of data to get; 'url' or 'pixels' or 'canvas'
2349
- */
2350
- getTopScreen(pName?: string, pType?: string): void
2351
-
2352
- /**
2353
- * sets the cursor of the client
2354
- * @env Client | Server
2355
- * @param {string} pCursor - 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
2356
- * @param {number} [pX] - optional; offsets the icon left or right by pX pixels
2357
- * @param {number} [pY] - optional; offsets the icon up or down by pY pixels
2358
- */
2359
- setMouseCursor(pCursor: string, pX?: number, pY?: number): void
2360
-
2361
- /**
2362
- * maximum number of frames the client will attempt to draw per second; default 60
2363
- * @env Client | Server
2364
- */
2365
- maxFPS: number
2366
-
2367
- /**
2368
- * removes a CSS style with the name pName
2369
- * @env Client | Server
2370
- * @param {string} pName - unique name of style
2371
- */
2372
- removeWebStyle(pName: string): void
2373
-
2374
- /**
2375
- * returns an object {'step': step, 'max': {'x': x, 'y': y}} containing delay details of client's view eye
2376
- * @env Client | Server
2377
- * @returns {{'step': number, 'max': {'x': number, 'y': number}}} returns an object {'step': step, 'max': {'x': x, 'y': y}} containing delay details of client's view eye
2378
- */
2379
- getViewEyeDelay(): {'step': number, 'max': {'x': number, 'y': number}}
2380
-
2381
- /**
2382
- * returns address of the client, 'localhost' for local or 'ip:port' if connected to a server
2383
- * @env Client | Server
2384
- * @returns {string} returns address of the client, 'localhost' for local or 'ip:port' if connected to a server
2385
- */
2386
- getAddress(): string
2387
-
2388
- /**
2389
- * returns an array of custom macro names
2390
- * @env Client | Server
2391
- * @returns {string[]} returns an array of custom macro names
2392
- */
2393
- getCustomMacroNames(): string[]
2394
-
2395
- /**
2396
- * returns an object {'x': x, 'y': y} containing the x and y position of the client's screen on the map
2397
- * @env Client | Server
2398
- * @param {object} [pO] - optional; an existing object to set the x and y of
2399
- * @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
2400
- */
2401
- getScreenPos(pO?: object): {'x': number, 'y': number}
2402
-
2403
- /**
2404
- * evaluates the JavaScript code in the pScript string; returns undefined on the server-side
2405
- * @env Client | Server
2406
- * @param {string} pScript - a string containing the JavaScript code to evaluate
2407
- * @returns {void} returns undefined on the server-side
2408
- */
2409
- evalWebScript(pScript: string): void
2410
-
2411
- /**
2412
- * amount of blank tiles that can be seen on the top and bottom of the view
2413
- * @env Client | Server
2414
- */
2415
- yEdgeLimit: number
2416
-
2417
- /**
2418
- * returns an object containing the mouse position; ex ( {'x': 0, 'y': 0} )
2419
- * @env Client | Server
2420
- * @returns {{'x': number, 'y': number}} returns an object containing the mouse position; ex ( {'x': 0, 'y': 0} )
2421
- */
2422
- getMousePos(): {'x': number, 'y': number}
2423
-
2424
- /**
2425
- * returns object currently being focused by this client
2426
- * @env Client | Server
2427
- * @returns {object} returns object currently being focused by this client
2428
- */
2429
- getFocus(): object
2430
-
2431
- /**
2432
- * 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
2433
- * @env Client | Server
2434
- * @param {number} [pPlane] - optional; value of plane to get
2435
- * @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
2436
- */
2437
- getPlane(pPlane?: number): Diob | Diob[]
2438
-
2439
- /**
2440
- * sets the client's game screen size to pWidth width and pHeight height
2441
- * @env Client | Server
2442
- * @param {number} pWidth - width as a number
2443
- * @param {number} pHeight - height as a number
2444
- */
2445
- setScreenSize(pWidth: number, pHeight: number): void
2446
-
2447
- /**
2448
- * returns an array of filter names
2449
- * @env Client | Server
2450
- * @returns {string[]} returns an array of filter names
2451
- */
2452
- getFilters(): string[]
2453
-
2454
- /**
2455
- * 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)
2456
- * @env Client | Server
2457
- * @param {number} pDelay - 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}}
2458
- */
2459
- setViewEyeDelay(pDelay: number): void
2460
-
2461
- /**
2462
- * removes an interface element from the interface
2463
- * @env Client | Server
2464
- * @param {string} pInterface - name of the interface to remove an interface element from
2465
- * @param {string} pName - name of the interface element to remove
2466
- */
2467
- removeInterfaceElement(pInterface: string, pName: string): void
2468
-
2469
- /**
2470
- * returns an object containing the width and height of the game screen; ex: {'width': 100, 'height': 100}
2471
- * @env Client | Server
2472
- * @param {object} [pO] - optional; an existing object to set the width and height of
2473
- * @returns {{'width': number, 'height': number}} returns an object containing the width and height of the game screen; ex: {'width': 100, 'height': 100}
2474
- */
2475
- getScreenSize(pO?: object): {'width': number, 'height': number}
2476
-
2477
- /**
2478
- * 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} )
2479
- * @env Client | Server
2480
- */
2481
- color: string | number[] | {'tint': number}
2482
-
2483
- /**
2484
- * creates a new interface file named pName
2485
- * @env Client | Server
2486
- * @param {string} pName - name of the interface to create
2487
- */
2488
- createInterface(pName: string): void
2489
-
2490
- /**
2491
- * 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
2492
- * @env Server
2493
- * @param {Diob} pD - reference to the diob to send
2494
- * @param {any[]} [pVar] - optional; variable name or array of variable names
2495
- */
2496
- sendDiob(pD: Diob, pVar?: any[]): void
2497
-
2498
- /**
2499
- * adds CSS style
2500
- * @env Client | Server
2501
- * @param {string} pName - unique name of style
2502
- * @param {any} pStyle - text as CSS to add to the client
2503
- */
2504
- addWebStyle(pName: string, pStyle: any): void
2505
-
2506
- /**
2507
- * removes the custom macro pName from the client's custom macros
2508
- * @env Client | Server
2509
- * @param {string} pName - name of the custom macro
2510
- */
2511
- removeCustomMacro(pName: string): void
2512
-
2513
- /**
2514
- * 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}}
2515
- * @env Client | Server
2516
- */
2517
- viewEyeDelay: {'step': number, 'max': {'x': number, 'y': number}}
2518
-
2519
- /**
2520
- * sets the client's playerMob to pMob
2521
- * @env Client | Server
2522
- * @param {Diob} pMob - reference to a Mob diob to give this client control of
2523
- */
2524
- setPlayerMob(pMob: Diob): void
2525
-
2526
- /**
2527
- * 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
2528
- * @env Client | Server
2529
- * @param {string} [pType] - optional; string containing type path to return
2530
- * @param {boolean} [pChild] - optional; boolean that determines if child types are included
2531
- * @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
2532
- */
2533
- getOverlays(pType?: string, pChild?: boolean): Diob[]
2534
-
2535
- /**
2536
- * optional; if set, the map will not scale based on the window size
2537
- * @env Client | Server
2538
- */
2539
- mapView: object
2540
-
2541
- }
2542
-
2543
-
2544
- type Resource = {
2545
-
2546
- /**
2547
- * sets a game resource to use the resource file located at pPath
2548
- * @env Client | Server
2549
- * @param {string} pType - type of file to set
2550
- * @param {string} pName - name of file to set; this will be referenced in the project; example if pName was set to 'my_atlas' ( atlasName = 'my_atlas' )
2551
- * @param {string} pPath - path to the file; if not a remote file this will be the name of the file (or path if any sub directories were added) inside resources/files/ for the game, otherwise it will be a web URL path to the file
2552
- * @param {any} [pRemote] - optional; if set the pPath file will be treated like a web URL
2553
- */
2554
- setResource(pType: string, pName: string, pPath: string, pRemote?: any): void
2555
-
2556
- /**
2557
- * returns the direct path to the resource
2558
- * @env Client | Server
2559
- * @param {string} pType - type of file to get
2560
- * @param {string} pName - name of file to get
2561
- * @returns {string} returns the direct path to the resource
2562
- */
2563
- getResourcePath(pType: string, pName: string): string
2564
-
2565
- /**
2566
- * loads the resource of type pType with the name pName and then calls the function pFunc
2567
- * @env Client | Server
2568
- * @param {string} pType - type of file to load
2569
- * @param {string} pName - name of file to load
2570
- * @param {Function} pFunc - function to call after the resource has finished loading or failed to load
2571
- */
2572
- loadResource(pType: string, pName: string, pFunc: Function): void
2573
-
2574
- /**
2575
- * returns a string containing the text inside of a loaded non-VS text file; the file must already be loaded to get the text
2576
- * @env Client | Server
2577
- * @param {string} pName - name of loaded file to get text of
2578
- * @returns {string} returns a string containing the text inside of a loaded non-VS text file; the file must already be loaded to get the text
2579
- */
2580
- getFileText(pName: string): string
2581
-
2582
- }
2583
-
2584
-
2585
- type Util = {
2586
-
2587
- /**
2588
- * returns pVal converted to a float number
2589
- * @env Client | Server
2590
- * @param {boolean} pVal - value to get number from
2591
- * @returns {number} returns pVal converted to a float number
2592
- */
2593
- parseFloat(pVal: boolean): number
2594
-
2595
- /**
2596
- * unzips gzipped data and returns the unzipped data
2597
- * @env Client | Server
2598
- * @param {any} pData - gzipped data
2599
- * @returns {string} returns the unzipped data
2600
- */
2601
- gzUnzip(pData: any): string
2602
-
2603
- /**
2604
- * returns a string containing the type of variable
2605
- * @env Client | Server
2606
- * @param {any} pVar - variable to check
2607
- * @returns {string} returns a string containing the type of variable
2608
- */
2609
- getVariableType(pVar: any): string
2610
-
2611
- /**
2612
- * handles either a stored callback function or a "callback array" and returns the results
2613
- * @env Client | Server
2614
- * @param {[Function, this: Diob | Object, [arg1: any, arg2: any]]} [pCallback] - reference to a function or a "callback array" which contains the reference to the callback function, followed by the call owner (the `this` of the function call), then an optional array of arguments; ex ( [this.func, this, [arg1, arg2]] )
2615
- * @returns {void} returns the results
2616
- */
2617
- handleCallback(pCallback?: [Function, this: Diob | Object, [arg1: any, arg2: any]]): void
2618
-
2619
- /**
2620
- * converts pRad into degrees and returns the number
2621
- * @env Client | Server
2622
- * @param {any} pRad - radians to convert
2623
- * @returns {number} returns the number
2624
- */
2625
- toDegrees(pRad: any): number
2626
-
2627
- /**
2628
- * returns pVal converted to a number value
2629
- * @env Client | Server
2630
- * @param {boolean} pVal - value to get number from
2631
- * @returns {number} returns pVal converted to a number value
2632
- */
2633
- toNumber(pVal: boolean): number
2634
-
2635
- /**
2636
- * creates an object from pString and returns it if the string is a valid object format
2637
- * @env Client | Server
2638
- * @param {string} pString - string to create an object from; ex ( "{'name': 'test', 'value1': 1}" )
2639
- * @returns {object | undefined} returns it if the string is a valid object format
2640
- */
2641
- stringToObject(pString: string): object | undefined
2642
-
2643
- /**
2644
- * returns new text that has been encoded to make it a valid URI component
2645
- * @env Client | Server
2646
- * @param {string} pText - text to encode
2647
- * @returns {string} returns new text that has been encoded to make it a valid URI component
2648
- */
2649
- encodeURIComponent(pText: string): string
2650
-
2651
- /**
2652
- * returns true if value is a string; returns false if value is not a string
2653
- * @env Client | Server
2654
- * @param {boolean} pVal - value to check for string
2655
- * @returns {string} returns true if value is a string; returns false if value is not a string
2656
- */
2657
- isString(pVal: boolean): string
2658
-
2659
- /**
2660
- * returns true if value is an object; returns false if value is not an object
2661
- * @env Client | Server
2662
- * @param {boolean} pVal - value to check for object
2663
- * @returns {boolean} returns true if value is an object; returns false if value is not an object
2664
- */
2665
- isObject(pVal: boolean): boolean
2666
-
2667
- /**
2668
- * text to encode HTML tags of
2669
- * @env Client | Server
2670
- * @param {string} pText - text to encode HTML tags of
2671
- * @returns {string} returns a new text with HTML tags encoded; '<' becomes '&amp;lt;', '>' becomes '&amp;gt;', '/' becomes '&amp;#47;'
2672
- */
2673
- encodeWebTags(pText: string): string
2674
-
2675
- /**
2676
- * returns new text that has been decoded
2677
- * @env Client | Server
2678
- * @param {string} pText - text to decode
2679
- * @returns {string} returns new text that has been decoded
2680
- */
2681
- decodeURI(pText: string): string
2682
-
2683
- /**
2684
- * converts pDeg into radians and returns the number
2685
- * @env Client | Server
2686
- * @param {any} pDeg - degrees to convert
2687
- * @returns {number} returns the number
2688
- */
2689
- toRadians(pDeg: any): number
2690
-
2691
- /**
2692
- * returns true if value is an array; returns false if value is not an array
2693
- * @env Client | Server
2694
- * @param {boolean} pVal - value to check for array
2695
- * @returns {boolean} returns true if value is an array; returns false if value is not an array
2696
- */
2697
- isArray(pVal: boolean): boolean
2698
-
2699
- /**
2700
- * returns an array containing the values of pO
2701
- * @env Client | Server
2702
- * @param {object} pO - object to get values from
2703
- * @returns {any[]} returns an array containing the values of pO
2704
- */
2705
- getObjectValues(pO: object): any[]
2706
-
2707
- /**
2708
- * copies all variables from pC and gives them to pO; warning: trying to copy an object that has recursive references will reach a stack limit and throw an error
2709
- * @env Client | Server
2710
- * @param {object} pO - object to set variables of
2711
- * @param {object} pC - object to copy variables from
2712
- * @param {boolean} [pD] - optional; set this if copying from a Vylocity Object or an object that references another Vylocity Object
2713
- */
2714
- copyObject(pO: object, pC: object, pD?: boolean): void
2715
-
2716
- /**
2717
- * returns new text that has been encoded to make it a valid URI
2718
- * @env Client | Server
2719
- * @param {string} pText - text to encode
2720
- * @returns {string} returns new text that has been encoded to make it a valid URI
2721
- */
2722
- encodeURI(pText: string): string
2723
-
2724
- /**
2725
- * returns a randomly picked item from pVal1 (if an array and pVal2 is not set) or all the arguments provided
2726
- * @env Client | Server
2727
- * @param {any[]} pValn - first value to pick from or an array to pick from
2728
- * @returns {any} returns a randomly picked item from pVal1 (if an array and pVal2 is not set) or all the arguments provided
2729
- */
2730
- pick(pValn: any[]): any
2731
-
2732
- /**
2733
- * returns pVal converted to a whole number
2734
- * @env Client | Server
2735
- * @param {boolean} pVal - value to get number from
2736
- * @param {number} pRadix - number between 2 and 36 to use as the base for the supplied number; 10 for normal base (0-9), 16 for hex (0-F)
2737
- * @returns {number} returns pVal converted to a whole number
2738
- */
2739
- parseInt(pVal: boolean, pRadix: number): number
2740
-
2741
- /**
2742
- * returns a regular expression pattern from the pPattern string using the pFlags flag
2743
- * @env Client | Server
2744
- * @param {any} pPattern - regular expression (regex) pattern string
2745
- * @param {any} [pFlags] - optional; 'g' = global match; 'i' = ignore case; 'm' = multiline, treat start and end characters (^ and $) as working over multiple lines;
2746
- * @returns {RegExp} returns a regular expression pattern from the pPattern string using the pFlags flag
2747
- */
2748
- regExp(pPattern: any, pFlags?: any): RegExp
2749
-
2750
- /**
2751
- * returns char or string associated with the code pCode
2752
- * @env Client | Server
2753
- * @param {any} pCode - code to get character of; can use multiple codes separated by commas which returns the codes as a string
2754
- * @returns {string} returns the codes as a string<br />
2755
- called: returns char or string associated with the code pCode
2756
- */
2757
- getCharFromCode(pCode: any): string
2758
-
2759
- /**
2760
- * returns true if value is a number; returns false if value is not a number
2761
- * @env Client | Server
2762
- * @param {boolean} pVal - value to check for number
2763
- * @returns {boolean} returns true if value is a number; returns false if value is not a number
2764
- */
2765
- isNumber(pVal: boolean): boolean
2766
-
2767
- /**
2768
- * returns new style as text after being processed by the engine, translating vyi: and vyf: tags and so on
2769
- * @env Client | Server
2770
- * @param {string} pStyle - string containing web styles
2771
- * @returns {void} returns new style as text after being processed by the engine, translating vyi: and vyf: tags and so on
2772
- */
2773
- getWebStyle(pStyle: string): void
2774
-
2775
- /**
2776
- * returns true if value is a function; returns false if value is not a function
2777
- * @env Client | Server
2778
- * @param {boolean} pVal - value to check for function
2779
- * @returns {boolean} returns true if value is a function; returns false if value is not a function
2780
- */
2781
- isFunction(pVal: boolean): boolean
2782
-
2783
- /**
2784
- * returns an array containing the values all of key names (variable names) of pO
2785
- * @env Client | Server
2786
- * @param {object} pO - object to get key names from
2787
- * @returns {string[]} returns an array containing the values all of key names (variable names) of pO
2788
- */
2789
- getObjectKeys(pO: object): string[]
2790
-
2791
- /**
2792
- * converts an ArrayBuffer to a base64 string
2793
- * @env Client | Server
2794
- * @param {any} pArrBuff - ArrayBuffer to convert to base64
2795
- */
2796
- arrayBufferToBase64(pArrBuff: any): void
2797
-
2798
- /**
2799
- * returns pVal converted to a string value
2800
- * @env Client | Server
2801
- * @param {boolean} pVal - value to get string from
2802
- * @returns {string} returns pVal converted to a string value
2803
- */
2804
- toString(pVal: boolean): string
2805
-
2806
- /**
2807
- * returns new text that has been decoded
2808
- * @env Client | Server
2809
- * @param {string} pText - text to decode
2810
- * @returns {string} returns new text that has been decoded
2811
- */
2812
- decodeURIComponent(pText: string): string
2813
-
2814
- /**
2815
- * gets all the variables that can be saved and returns a new object that contains those values which can then be saved (no internal engine variables, no functions, no references to Vylocity Objects)
2816
- * @env Client | Server
2817
- * @param {object} pS - object to get saveable values from
2818
- * @param {object} [pO] - optional; alter this object and return it as the return object
2819
- * @returns {object} returns a new object that contains those values which can then be saved (no internal engine variables, no functions, no references to Vylocity Objects)
2820
- */
2821
- getSaveObject(pS: object, pO?: object): object
2822
-
2823
- }
2824
-
2825
-
2826
- type Event = {
2827
-
2828
- /**
2829
- * remove pO to the ticker
2830
- * @env Client | Server
2831
- * @param {any} pO - reference to the object
2832
- */
2833
- removeTicker(pO: any): void
2834
-
2835
- /**
2836
- * add pO to the ticker
2837
- * @env Client | Server
2838
- * @param {any} pO - reference to the object
2839
- * @param {object} [pS] - optional; an object containing settings for this object's ticker
2840
- */
2841
- addTicker(pO: any, pS?: object): void
2842
-
2843
- /**
2844
- * forces a thread to stop doing its executions
2845
- * @env Client | Server
2846
- * @param {boolean} pVal - variable linking to the thread to be interrupted
2847
- */
2848
- interruptThread(pVal: boolean): void
2849
-
2850
- /**
2851
- * returns an array of all active objects with tickers running
2852
- * @env Client | Server
2853
- * @returns {Diob[] | Object[]} returns an array of all active objects with tickers running
2854
- */
2855
- getTickers(): Diob[] | Object[]
2856
-
2857
- /**
2858
- * prevents a specific spawn from occuring
2859
- * @env Client | Server
2860
- * @param {boolean} pVal - variable linking to the spawn to be interrupted
2861
- */
2862
- interruptSpawn(pVal: boolean): void
2863
-
2864
- /**
2865
- * pauses or resumes all tickers
2866
- * @env Client | Server
2867
- * @param {boolean} [pBool] - optional; true or false
2868
- */
2869
- toggleTicker(pBool?: boolean): void
2870
-
2871
- }
2872
-
2873
-
2874
- type File = {
2875
-
2876
- /**
2877
- * checks if pFile exists
2878
- * @env Server
2879
- * @param {string} pFile - path to the file or directory to check
2880
- * @param {Function} pFunc - function to call after pPath has been checked; first argument pExists determines if pPath exists or not
2881
- */
2882
- exists(pFile: string, pFunc: Function): void
2883
-
2884
- /**
2885
- * returns an object containing stat information for the file at pPath and calls pFunc with the first argument being the stat object and the second being an error (if any)
2886
- * @env Server
2887
- * @param {string} pPath - path to the file to get stats for
2888
- * @param {Function} pFunc - function to call after
2889
- * @returns {object} returns an object containing stat information for the file at pPath and calls pFunc with the first argument being the stat object and the second being an error (if any)
2890
- */
2891
- getStats(pPath: string, pFunc: Function): object
2892
-
2893
- /**
2894
- * reads the data and returns the data in pFunc
2895
- * @env Server
2896
- * @param {string} pFile - path to the file
2897
- * @param {Function} pFunc - function to call after reading is complete; first argument pData is set to the data read; second arg pErr is set if an error has occured
2898
- * @returns {void} returns the data in pFunc
2899
- */
2900
- readText(pFile: string, pFunc: Function): void
2901
-
2902
- /**
2903
- * creates pFile if it does not exist and then saves the pSave object to the file; overwrites existing data
2904
- * @env Server
2905
- * @param {string} pFile - path to the file
2906
- * @param {object} pSave - object to save to the file for example ( {'value1': 1, 'value2': 2} )
2907
- * @param {Function} pFunc - function to call after writing is complete; first argument pErr is set if an error has occured
2908
- */
2909
- writeSave(pFile: string, pSave: object, pFunc: Function): void
2910
-
2911
- /**
2912
- * creates pFile if needed and then add pData to the end of the file
2913
- * @env Server
2914
- * @param {string} pFile - path to the file
2915
- * @param {any} pData - text to add to the end of pFile
2916
- * @param {Function} pFunc - function to call after appending is complete; first argument pErr is set if an error has occured
2917
- */
2918
- appendText(pFile: string, pData: any, pFunc: Function): void
2919
-
2920
- /**
2921
- * provides an array of files in pPath directory
2922
- * @env Server
2923
- * @param {string} pPath - path to the directory
2924
- * @param {Function} pFunc - function to call after the directory has been read; first argument pFiles is an array of the files in the directory, second argument pErr is an error if there is one
2925
- */
2926
- readDir(pPath: string, pFunc: Function): void
2927
-
2928
- /**
2929
- * deletes the file or directory at pPath; all child files are also deleted
2930
- * @env Server
2931
- * @param {string} pPath - path to the file or directory to delete
2932
- * @param {Function} pFunc - function to call after pPath has been removed
2933
- */
2934
- remove(pPath: string, pFunc: Function): void
2935
-
2936
- /**
2937
- * provides a stat object which contains information on the file; you can use isFile() and isDirectory() on the object to check if they are files or directories
2938
- * @env Server
2939
- * @param {string} pPath - path to the file or directory
2940
- * @param {Function} pFunc - function to call after pPath has been checked; first argument pStat is an object containing stat information for the file, second argument pErr is an error if there is one
2941
- */
2942
- stat(pPath: string, pFunc: Function): void
2943
-
2944
- /**
2945
- * creates a new directory at the location of pPath
2946
- * @env Server
2947
- * @param {string} pPath - path to create the new directory
2948
- * @param {Function} pFunc - function to call after the directory has been made
2949
- */
2950
- makeDir(pPath: string, pFunc: Function): void
2951
-
2952
- /**
2953
- * returns an array of file names inside the pPath dir and calls pFunc with the first argument being the array and the second being an error (if any)
2954
- * @env Server
2955
- * @param {string} pPath - path to the directory to get contents of
2956
- * @param {Function} pFunc - function to call after
2957
- * @returns {string[]} returns an array of file names inside the pPath dir and calls pFunc with the first argument being the array and the second being an error (if any)
2958
- */
2959
- getDir(pPath: string, pFunc: Function): string[]
2960
-
2961
- /**
2962
- * reads pFile and returns an object from the data in pFunc
2963
- * @env Server
2964
- * @param {string} pFile - path to the file
2965
- * @param {Function} pFunc - function to call after reading is complete; first argument pData is set to the data read; second arg pErr is set if an error has occured
2966
- * @returns {object} returns an object from the data in pFunc
2967
- */
2968
- readSave(pFile: string, pFunc: Function): object
2969
-
2970
- /**
2971
- * creates pFile if needed and then writes pData to the file; overwrites existing data
2972
- * @env Server
2973
- * @param {string} pFile - path to the file
2974
- * @param {any} pData - text to put into the file
2975
- * @param {Function} pFunc - function to call after writing is complete; first argument pErr is set if an error occurs
2976
- */
2977
- writeText(pFile: string, pData: any, pFunc: Function): void
2978
-
2979
- }
2980
-
2981
-
2982
- type Icon = {
2983
-
2984
- /**
2985
- * creates a new blank icon named pIcon inside of the atlas pAtlas
2986
- * @env Client | Server
2987
- * @param {string} pAtlas - name of the icon atlas to add the icon to
2988
- * @param {string} pIcon - name of the new icon
2989
- * @param {number} [pWidth] - optional; width of the new icon; uses tileWidth if not defined
2990
- * @param {number} [pHeight] - optional; height of the new icon; uses tileHeight if not defined
2991
- */
2992
- newIcon(pAtlas: string, pIcon: string, pWidth?: number, pHeight?: number): void
2993
-
2994
- /**
2995
- * alters color of the specified icon(s) based on the specified info; For example {'type': 'normal', 'red': 100} or just {'red': 100} would add 100 red to all pixels; {'red': -100} would reduce 100 red from all pixels; {'type': 'swap', 'red': 100, 'blue': 100, 'green': 100, 'newRed': 200} would find all pixels with the color rgb(100, 100, 100) and replace it with rgb(200, 100, 100); If any of the colors are not included, such as 'alpha', it will ignore that color, otherwise if it is set, it will take that color into account; {'type': 'multiply', 'hex': '#FFF'} would multiply blend white onto the icon, you can use 'hex' for the red, green, and blue values; for 'swap' you can use 'colors' which should equal an array of objects containing all of the color swaps you want to do if there is more than one
2996
- * @env Client | Server
2997
- * @param {object} pInfo - an object containing information to be used for the color alteration
2998
- * @param {string} pAtlas - name of the icon atlas involved
2999
- * @param {string} pIcon - name of the icon involved
3000
- * @param {string} [pState] - optional; name of the icon state involved
3001
- * @param {number} [pFrame] - optional; number of the frame involved
3002
- * @param {Function} [pFunc] - optional; function to call after the icon has changed; passes an error as the first argument if there was en error
3003
- */
3004
- alterColor(pInfo: object, pAtlas: string, pIcon: string, pState?: string, pFrame?: number, pFunc?: Function): void
3005
-
3006
- /**
3007
- * returns object containing the width and height of the icon; ex {'width': 100, 'height': 100}
3008
- * @env Client | Server
3009
- * @param {string} pAtlas - name of the icon atlas
3010
- * @param {string} pIcon - name of the icon
3011
- * @param {string} [pState] - optional; name of the state
3012
- * @param {number} [pFrame] - optional; number of the frame
3013
- * @returns {object} returns object containing the width and height of the icon; ex {'width': 100, 'height': 100}
3014
- */
3015
- getIconSize(pAtlas: string, pIcon: string, pState?: string, pFrame?: number): object
3016
-
3017
- /**
3018
- * returns a string containing the base64 data url for the icon which can then be used to display the icon as an image in HTML
3019
- * @env Client | Server
3020
- * @param {string} pAtlas - name of the icon atlas
3021
- * @param {string} pIcon - name of the icon
3022
- * @param {string} [pState] - optional; name of the state
3023
- * @param {number} [pFrame] - optional; number of the frame
3024
- * @returns {string} returns a string containing the base64 data url for the icon which can then be used to display the icon as an image in HTML
3025
- */
3026
- getDataURL(pAtlas: string, pIcon: string, pState?: string, pFrame?: number): string
3027
-
3028
- /**
3029
- * grabs an object with the width and height of the icon and an array of pixel data for the entire icon. The array of pixel data can then be changed and used elsewhere or drawn onto another icon. 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.
3030
- * @env Client | Server
3031
- * @param {string} pAtlas - name of the icon atlas involved
3032
- * @param {string} pIcon - name of the icon involved
3033
- * @param {string} [pState] - optional; name of the icon state involved
3034
- * @param {number} [pFrame] - optional; number of the frame involved
3035
- */
3036
- getRawData(pAtlas: string, pIcon: string, pState?: string, pFrame?: number): ArrayBuffer
3037
-
3038
- /**
3039
- * change frame pFrame delay to pDelay
3040
- * @env Client | Server
3041
- * @param {string} pAtlas - name of the icon atlas to add the frame to
3042
- * @param {string} pIcon - name of the icon involved
3043
- * @param {string} pState - name of the icon state involved
3044
- * @param {number} pFrame - frame number
3045
- * @param {number} pDelay - delay number
3046
- */
3047
- setFrameDelay(pAtlas: string, pIcon: string, pState: string, pFrame: number, pDelay: number): void
3048
-
3049
- /**
3050
- * get delay of pFrame
3051
- * @env Client | Server
3052
- * @param {string} pAtlas - name of the icon atlas to add the frame to
3053
- * @param {string} pIcon - name of the icon involved
3054
- * @param {string} pState - name of the icon state involved
3055
- * @param {number} pFrame - frame number
3056
- */
3057
- getFrameDelay(pAtlas: string, pIcon: string, pState: string, pFrame: number): void
3058
-
3059
- /**
3060
- * loads all the images for each specified icon; icon images are loaded when an icon or state is shown to a client, if you plan on altering an icon that the client hasn't seen yet, you'll want to use this function to cache it first
3061
- * @env Client | Server
3062
- * @param {string} pAtlas - name of the icon atlas
3063
- * @param {string} [pIcon] - optional; name of the icon
3064
- * @param {Function} [pFunc] - optional; function called after the images have been loaded and cached
3065
- */
3066
- cacheImage(pAtlas: string, pIcon?: string, pFunc?: Function): void
3067
-
3068
- /**
3069
- * returns an array of strings containing the names of all the icons in pAtlas
3070
- * @env Client | Server
3071
- * @param {string} pAtlas - name of the icon atlas
3072
- * @returns {string[]} returns an array of strings containing the names of all the icons in pAtlas
3073
- */
3074
- getIconNames(pAtlas: string): string[]
3075
-
3076
- /**
3077
- * returns number of frames the icon has
3078
- * @env Client | Server
3079
- * @param {string} pAtlas - name of the icon atlas to add the frame to
3080
- * @param {string} pIcon - name of the icon involved
3081
- * @param {string} pState - name of the icon state involved
3082
- * @returns {number} returns number of frames the icon has
3083
- */
3084
- getFrameCount(pAtlas: string, pIcon: string, pState: string): number
3085
-
3086
- /**
3087
- * creates a new blank frame; if pState is defined the frame is added to the state, otherwise it is added to pIcon
3088
- * @env Client | Server
3089
- * @param {number} pDelay - number of milliseconds to give the frame delay; null for default, which is 100
3090
- * @param {string} pAtlas - name of the icon atlas to add the frame to
3091
- * @param {string} pIcon - name of the icon involved
3092
- * @param {string} [pState] - optional; name of the icon state involved
3093
- */
3094
- newFrame(pDelay: number, pAtlas: string, pIcon: string, pState?: string): void
3095
-
3096
- /**
3097
- * creates a clone of an atlas, icon, icon state, or frame
3098
- * @env Client | Server
3099
- * @param {object} pArgs - an object containing the information for the clone; useable varables: 'atlas', 'newAtlas', 'icon', 'newIcon', 'state', 'newState', and 'frame'
3100
- */
3101
- clone(pArgs: object): void
3102
-
3103
- /**
3104
- * creates a new blank icon state named pState for pIcon in the atlas pAtlas
3105
- * @env Client | Server
3106
- * @param {string} pAtlas - name of the icon atlas to add the icon state to
3107
- * @param {string} pIcon - name of the icon to add the icon state to
3108
- * @param {string} pState - name of the new icon state
3109
- */
3110
- newIconState(pAtlas: string, pIcon: string, pState: string): void
3111
-
3112
- /**
3113
- * performs the specified draw function on the specified icon using the specified pArgs object; ex ( {'type': 'image', 'image': this, 'x': 1, 'y': 1} )
3114
- * @env Client | Server
3115
- * @param {object | object[]} pArgs - an object or array of objects which determines the settings of the draw
3116
- * @param {string} pAtlas - type of draw
3117
- * @param {string} pIcon - draw an image
3118
- * @param {string} pState - either a path to an image or a diob (in which case the diob's icon will be used) or an object containing icon information (ex {'atlasName': 'test', 'iconName': 'a', 'iconState': 's', 'frame': 2} )
3119
- * @param {number} pFrame - x position to draw the image
3120
- * @param {Function} pFunc - y position to draw the image
3121
- */
3122
- draw(pArgs: object | object[], pAtlas: string, pIcon: string, pState: string, pFrame: number, pFunc: Function): void
3123
-
3124
- /**
3125
- * changes the icon to match the pixel data given with pData
3126
- * @env Client | Server
3127
- * @param {any} pData - pixel data object to use
3128
- * @param {string} pAtlas - name of the icon atlas involved
3129
- * @param {string} pIcon - name of the icon involved
3130
- * @param {string} [pState] - optional; name of the icon state involved
3131
- * @param {number} [pFrame] - optional; number of the frame involved
3132
- * @param {Function} [pFunc] - optional; function to call after the icon data has changed and loaded
3133
- */
3134
- setRawData(pData: any, pAtlas: string, pIcon: string, pState?: string, pFrame?: number, pFunc?: Function): void
3135
-
3136
- /**
3137
- * returns an array of strings containing the names of all the icon states belonging to the icon pIcon in icon atlas pAtlas
3138
- * @env Client | Server
3139
- * @param {string} pAtlas - name of the icon atlas
3140
- * @param {string} pIcon - name of the icon
3141
- * @returns {string[]} returns an array of strings containing the names of all the icon states belonging to the icon pIcon in icon atlas pAtlas
3142
- */
3143
- getIconStateNames(pAtlas: string, pIcon: string): string[]
3144
-
3145
- /**
3146
- * create a new icon atlas with the name pAtlas
3147
- * @env Client | Server
3148
- */
3149
- newAtlas(): void
3150
-
3151
- /**
3152
- * sets the image of the specified icon using the pData data URL
3153
- * @env Client | Server
3154
- * @param {any} pData - text containing data URL
3155
- * @param {string} pAtlas - name of the icon atlas
3156
- * @param {string} pIcon - name of the icon
3157
- * @param {string} [pState] - optional; name of the state
3158
- * @param {number} [pFrame] - optional; number of the frame
3159
- * @param {Function} [pFunc] - optional; function to call after the icon has changed; passes an error as the first argument if there was en error
3160
- */
3161
- setDataURL(pData: any, pAtlas: string, pIcon: string, pState?: string, pFrame?: number, pFunc?: Function): void
3162
-
3163
- /**
3164
- * applies a filter to the icon(s) involved; possible filter types: 'grayscale', 'invert', 'darken', 'lighten'
3165
- * @env Client | Server
3166
- * @param {object} pFilter - an object containing needed information for filter; {'type': 'darken', 'value': 10} would darken the image by 10;
3167
- * @param {string} pAtlas - name of the icon atlas involved
3168
- * @param {string} pIcon - name of the icon involved
3169
- * @param {string} [pState] - optional; name of the icon state involved
3170
- * @param {number} [pFrame] - optional; number of the frame involved
3171
- * @param {Function} [pFunc] - optional; function to call after the icon has changed; passes an error as the first argument if there was en error
3172
- */
3173
- applyFilter(pFilter: object, pAtlas: string, pIcon: string, pState?: string, pFrame?: number, pFunc?: Function): void
3174
-
3175
- }
3176
-
3177
-
3178
- type Map = {
3179
-
3180
- /**
3181
- * returns number of tiles between pA and pB
3182
- * @env Client | Server
3183
- * @param {Diob | Object} pA - Diob reference or object containing location information; ex {'xCoord': 1, 'yCoord': 1, 'mapName': 'map'}
3184
- * @param {Diob | Object} pB - Diob reference or object containing location information; ex {'xCoord': 1, 'yCoord': 1, 'mapName': 'map'}
3185
- * @returns {number} returns number of tiles between pA and pB
3186
- */
3187
- getTileDist(pA: Diob | Object, pB: Diob | Object): number
3188
-
3189
- /**
3190
- * returns an array of diobs on the map pMap depending on the provided arguments; if pType is not set, all diobs on the map will be returned; if pType is set but pChild is not, diobs on the map 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 on the map will be returned
3191
- * @env Client | Server
3192
- * @param {string} pMap - name of the map to get diobs from
3193
- * @param {string} [pType] - optional; string containing type path to return
3194
- * @param {boolean} [pChild] - optional; boolean that determines if child types are included
3195
- * @param {Diob[]} [pAdd] - optional; if set, tiles and regions on the map will also be returned
3196
- * @returns {Diob[]} returns an array of diobs on the map pMap depending on the provided arguments; if pType is not set, all diobs on the map will be returned; if pType is set but pChild is not, diobs on the map 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 on the map will be returned
3197
- */
3198
- getDiobs(pMap: string, pType?: string, pChild?: boolean, pAdd?: Diob[]): Diob[]
3199
-
3200
- /**
3201
- * changes the sized of pMap to the width and height of pW and pH; reducing the size will delete diobs that are no longer within the map size
3202
- * @env Client | Server
3203
- * @param {string} pMap - name of the map to set the size of
3204
- * @param {number} pW - width in tiles to give the map
3205
- * @param {number} pH - height in tiles to give the map
3206
- * @param {string} pTile - tile object type to use as the default tiles for newly created tiles
3207
- */
3208
- setMapSize(pMap: string, pW: number, pH: number, pTile: string): void
3209
-
3210
- /**
3211
- * returns an array containing all the non-tile diobs on the map within x and y tiles around the specified diob that are visible to the diob
3212
- * @env Client | Server
3213
- * @param {Diob | Object} pO - diob or range object to get range from; range object example {'map': 'name', 'x': 1, 'y': 1}; using a range object will use the tile at the specified location for the reference diob
3214
- * @param {boolean} pOmit - either x distance or x and y distance
3215
- * @returns {Diob[]} returns an array containing all the non-tile diobs on the map within x and y tiles around the specified diob that are visible to the diob
3216
- */
3217
- getTileRangeView(pO: Diob | Object, pOmit: boolean): Diob[]
3218
-
3219
- /**
3220
- * sets the Tile at pLoc to pT and returns the new tile
3221
- * @env Client | Server
3222
- * @param {Diob | Object} pLoc - either a Tile reference or an object containing location information; ex {'xCoord': 1, 'yCoord': 1, 'mapName': 'map'}
3223
- * @param {string} pT - either a type string containing the type of a new Tile or a reference to a Tile that does not already have a location on the map
3224
- * @returns {Diob} returns the new tile
3225
- */
3226
- setLoc(pLoc: Diob | Object, pT: string): Diob
3227
-
3228
- /**
3229
- * returns the tiles on pMap within the specified area; if no area is specified, all tiles will be returned
3230
- * @env Client | Server
3231
- * @param {string} pMap - name of the map to get tiles from
3232
- * @param {number} [pX] - optional; starting x coordinate
3233
- * @param {number} [pY] - optional; starting y coordinate
3234
- * @param {number} [pW] - optional; number of tiles to get from the right of pX; negative numbers to get tiles from the left
3235
- * @param {number} [pH] - optional; number of tiles to get from below pY; negative numbers to get tiles from above
3236
- * @returns {Diob[]} returns the tiles on pMap within the specified area; if no area is specified, all tiles will be returned
3237
- */
3238
- getTiles(pMap: string, pX?: number, pY?: number, pW?: number, pH?: number): Diob[]
3239
-
3240
- /**
3241
- * returns an array of diobs on the map pMap that have the tag pTag
3242
- * @env Client | Server
3243
- * @param {string} pTag - string containing tag to look for
3244
- * @param {string} [pMap] - optional; name of map to search
3245
- * @returns {Diob[]} returns an array of diobs on the map pMap that have the tag pTag
3246
- */
3247
- getDiobsByTag(pTag: string, pMap?: string): Diob[]
3248
-
3249
- /**
3250
- * returns number of pixels between the center of pA and the center of pB; you can change the origin by passing custom objects and changing the width and height by double of the amount to offset
3251
- * @env Client | Server
3252
- * @param {Diob | Object} pA - Diob reference or object containing location and size information; ex {'xPos': 1, 'yPos': 1, 'mapName': 'map', 'width': 32, 'height': 32}
3253
- * @param {Diob | Object} pB - Diob reference or object containing location and size information; ex {'xPos': 1, 'yPos': 1, 'mapName': 'map', 'width': 32, 'height': 32}
3254
- * @param {boolean} [pEdge] - optional; if set, the edges of the diobs will be used instead of the center
3255
- * @returns {number} returns number of pixels between the center of pA and the center of pB; you can change the origin by passing custom objects and changing the width and height by double of the amount to offset
3256
- */
3257
- getDist(pA: Diob | Object, pB: Diob | Object, pEdge?: boolean): number
3258
-
3259
- /**
3260
- * returns a the angle in radians between pA and pB
3261
- * @env Client | Server
3262
- * @param {Diob | Object} pA - first diob
3263
- * @param {Diob | Object} pB - second diob
3264
- * @param {boolean} pCenter - set to get angle from the centers
3265
- * @returns {number} returns a the angle in radians between pA and pB
3266
- */
3267
- getAngle(pA: Diob | Object, pB: Diob | Object, pCenter: boolean): number
3268
-
3269
- /**
3270
- * returns an array containing all the non-tile diobs on the map within x and y positional units around the specified diob that are visible to the diob and that have the same type as pType or a parent type of pType if pChild is enabled
3271
- * @env Client | Server
3272
- * @param {Diob | Object} pO - diob or range object to get range from; range object example {'map': 'name', 'x': 1, 'y': 1}; using a range object will use the tile at the specified location for the reference diob
3273
- * @param {string} pType - type or parent type of diobs to get
3274
- * @param {boolean} pChild - true to include all child diobs; false to include only diobs with the exact type of pType
3275
- * @param {boolean} pOmit - either x distance or x and y distance
3276
- * @returns {Diob[]} returns an array containing all the non-tile diobs on the map within x and y positional units around the specified diob that are visible to the diob and that have the same type as pType or a parent type of pType if pChild is enabled
3277
- */
3278
- getRangeViewByType(pO: Diob | Object, pType: string, pChild: boolean, pOmit: boolean): Diob[]
3279
-
3280
- /**
3281
- * returns an array containing all the non-tile diobs on the map within x and y tiles around the specified diob that are able to see the diob and that have the same type as pType or a parent type of pType if pChild is enabled
3282
- * @env Client | Server
3283
- * @param {Diob | Object} pO - diob or range object to get range from; range object example {'map': 'name', 'x': 1, 'y': 1}; using a range object will use the tile at the specified location for the reference diob
3284
- * @param {string} pType - type or parent type of diobs to get
3285
- * @param {boolean} pChild - true to include all child diobs; false to include only diobs with the exact type of pType
3286
- * @param {boolean} pOmit - either x distance or x and y distance
3287
- * @returns {Diob[]} returns an array containing all the non-tile diobs on the map within x and y tiles around the specified diob that are able to see the diob and that have the same type as pType or a parent type of pType if pChild is enabled
3288
- */
3289
- getTileRangeViewersByType(pO: Diob | Object, pType: string, pChild: boolean, pOmit: boolean): Diob[]
3290
-
3291
- /**
3292
- * reference to a tile that exists in the void, this tile is used if a movable interacts with the edge of the map
3293
- * @env Client | Server
3294
- */
3295
- void: Diob
3296
-
3297
- /**
3298
- * array containing all the direction strings; ['east', 'northeast', 'north', 'northwest', 'west', 'southwest', 'south', 'southeast']
3299
- * @env Client | Server
3300
- */
3301
- dirs: ['east', 'northeast', 'north', 'northwest', 'west', 'southwest', 'south', 'southeast']
3302
-
3303
- /**
3304
- * returns an array containing all the tiles on the map within x and y pixels around the specified diob
3305
- * @env Client | Server
3306
- * @param {Diob | Object} pD - diob or range object to get range from; range object example {'map': 'name', 'x': 1, 'y': 1}; using a range object will use the tile at the specified location for the reference diob
3307
- * @param {string} pType - either x distance or x and y distance
3308
- * @param {boolean} pChild - if set, y distance
3309
- * @param {boolean} pOmit - type or parent type of tiles to get
3310
- * @returns {Diob[]} returns an array containing all the tiles on the map within x and y pixels around the specified diob
3311
- */
3312
- getTilesByRange(pD: Diob | Object, pType: string, pChild: boolean, pOmit: boolean): Diob[]
3313
-
3314
- /**
3315
- * returns a tile of a given location; if pVal1 and pVal2 are numbers and pVal3 is a string, it returns the tile at the coordinates pVal1, pVal2 on the map pVal3; if pVal1 is an object and not a tile, it returns the object's location; if pVal1 is a tile, it returns the tile back
3316
- * @env Client | Server
3317
- * @returns {Diob} returns a tile of a given location; if pVal1 and pVal2 are numbers and pVal3 is a string, it returns the tile at the coordinates pVal1, pVal2 on the map pVal3; if pVal1 is an object and not a tile, it returns the object's location; if pVal1 is a tile, it returns the tile back
3318
- */
3319
- getLoc(): Diob
3320
-
3321
- /**
3322
- * returns the Tile next to the location of pL based on the direction of pDir
3323
- * @env Client | Server
3324
- * @param {Diob | Object} pL - reference to Diob or location object; ex {'xCoord': 1, 'yCoord': 1, 'mapName': 'map'}
3325
- * @param {string} pDir - string containing direction
3326
- * @returns {Diob} returns the Tile next to the location of pL based on the direction of pDir
3327
- */
3328
- getLocByDir(pL: Diob | Object, pDir: string): Diob
3329
-
3330
- /**
3331
- * deletes the map and all diobs on it
3332
- * @env Client | Server
3333
- * @param {string} pName - name of the map to delete
3334
- */
3335
- deleteMap(pName: string): void
3336
-
3337
- /**
3338
- * returns the Tile by the position pX, pY on the map pMap
3339
- * @env Client | Server
3340
- * @param {number} pX - x position
3341
- * @param {number} pY - y position
3342
- * @param {string} pMap - map name
3343
- * @returns {Diob} returns the Tile by the position pX, pY on the map pMap
3344
- */
3345
- getLocByPos(pX: number, pY: number, pMap: string): Diob
3346
-
3347
- /**
3348
- * returns an array of all map names of maps currently loaded
3349
- * @env Client | Server
3350
- * @returns {string[]} returns an array of all map names of maps currently loaded
3351
- */
3352
- getMaps(): string[]
3353
-
3354
- /**
3355
- * returns a string containing the direction from pA to pB from their origins
3356
- * @env Client | Server
3357
- * @param {Diob | Object} pA - first diob
3358
- * @param {Diob | Object} pB - second diob
3359
- * @param {boolean} pCenter - set to get dir from the centers
3360
- * @param {boolean} pCard - if set, only cardinal directions will be returned (north, south, east, west)
3361
- * @returns {string[]} returns a string containing the direction from pA to pB from their origins
3362
- */
3363
- getDir(pA: Diob | Object, pB: Diob | Object, pCenter: boolean, pCard: boolean): string[]
3364
-
3365
- /**
3366
- * returns an array of diobs in the Region pR on all loaded maps or on the map pMap if specified with a type of pType (if specified) or a child of pType if pChild is set
3367
- * @env Client | Server
3368
- * @param {string} pR - either a type string containing the type of Region or a reference to a Region
3369
- * @param {string} pType - type or parent type of diobs to get
3370
- * @param {boolean} pChild - true to include all child diobs; false to include only diobs with the exact type of pType
3371
- * @param {string} [pMap] - optional; name of the map to check the Region of; if not set all loaded maps with the specified Region will be used
3372
- * @returns {any[]} returns an array of diobs in the Region pR on all loaded maps or on the map pMap if specified with a type of pType (if specified) or a child of pType if pChild is set
3373
- */
3374
- getDiobsByRegion(pR: string, pType: string, pChild: boolean, pMap?: string): any[]
3375
-
3376
- /**
3377
- * returns an array containing all the non-tile diobs on the map within x and y tiles around the specified diob that are able to see the diob
3378
- * @env Client | Server
3379
- * @param {Diob | Object} pO - diob or range object to get range from; range object example {'map': 'name', 'x': 1, 'y': 1}; using a range object will use the tile at the specified location for the reference diob
3380
- * @param {boolean} pOmit - either x distance or x and y distance
3381
- * @returns {Diob[]} returns an array containing all the non-tile diobs on the map within x and y tiles around the specified diob that are able to see the diob
3382
- */
3383
- getTileRangeViewers(pO: Diob | Object, pOmit: boolean): Diob[]
3384
-
3385
- /**
3386
- * returns an array of diobs on the map pMap 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 'Mob' with pChild undefined, all diobs with the exact type of 'Mob' will be returned, but if pChild is set, then all mobs on the map will be returned
3387
- * @env Client | Server
3388
- * @param {string} pMap - name of the map to get diobs from
3389
- * @param {number} pX - starting x position
3390
- * @param {number} pY - starting y position
3391
- * @param {string} [pType] - optional; ending x position
3392
- * @param {boolean} [pChild] - optional; ending y position
3393
- * @param {string} [pAdd] - optional; string containing type path to return
3394
- * @returns {any[]} returns an array of diobs on the map pMap 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 'Mob' with pChild undefined, all diobs with the exact type of 'Mob' will be returned, but if pChild is set, then all mobs on the map will be returned
3395
- */
3396
- getDiobsByPos(pMap: string, pX: number, pY: number, pType?: string, pChild?: boolean, pAdd?: string): any[]
3397
-
3398
- /**
3399
- * creates a new map which is a clone of a map file
3400
- * @env Client | Server
3401
- * @param {string} pMap - name of the map file to clone
3402
- * @param {string} pName - name to give the new cloned map
3403
- * @param {Function} [pFunc] - optional; function to call once the clone is finished
3404
- */
3405
- cloneMap(pMap: string, pName: string, pFunc?: Function): void
3406
-
3407
- /**
3408
- * returns an array containing all the non-tile diobs on the map within x and y positional units around the specified diob that are able to see the diob
3409
- * @env Client | Server
3410
- * @param {Diob | Object} pO - diob or range object to get range from; range object example {'map': 'name', 'x': 1, 'y': 1}; using a range object will use the tile at the specified location for the reference diob
3411
- * @param {boolean} pOmit - either x distance or x and y distance
3412
- * @returns {Diob[]} returns an array containing all the non-tile diobs on the map within x and y positional units around the specified diob that are able to see the diob
3413
- */
3414
- getRangeViewers(pO: Diob | Object, pOmit: boolean): Diob[]
3415
-
3416
- /**
3417
- * returns an array containing all the non-tile diobs on the map within x and y positional units around the specified diob
3418
- * @env Client | Server
3419
- * @param {Diob | Object} pO - diob or range object to get range from; range object example {'map': 'name', 'x': 1, 'y': 1}; using a range object will use the tile at the specified location for the reference diob
3420
- * @param {boolean} pOmit - either x distance or x and y distance
3421
- * @returns {Diob[]} returns an array containing all the non-tile diobs on the map within x and y positional units around the specified diob
3422
- */
3423
- getRange(pO: Diob | Object, pOmit: boolean): Diob[]
3424
-
3425
- /**
3426
- * returns an array containing all the non-tile diobs on the map within x and y positional units around the specified diob that have the same type as pType or a parent type of pType if pChild is enabled
3427
- * @env Client | Server
3428
- * @param {Diob | Object} pO - diob or range object to get range from; range object example {'map': 'name', 'x': 1, 'y': 1}; using a range object will use the tile at the specified location for the reference diob
3429
- * @param {string} pType - type or parent type of diobs to get
3430
- * @param {boolean} pChild - true to include all child diobs; false to include only diobs with the exact type of pType
3431
- * @param {boolean} pOmit - either x distance or x and y distance
3432
- * @returns {Diob[]} returns an array containing all the non-tile diobs on the map within x and y positional units around the specified diob that have the same type as pType or a parent type of pType if pChild is enabled
3433
- */
3434
- getRangeByType(pO: Diob | Object, pType: string, pChild: boolean, pOmit: boolean): Diob[]
3435
-
3436
- /**
3437
- * returns an array containing all the non-tile diobs on the map within x and y tiles around the specified diob that have the same type as pType or a parent type of pType if pChild is enabled
3438
- * @env Client | Server
3439
- * @param {Diob | Object} pO - diob or range object to get range from; range object example {'map': 'name', 'x': 1, 'y': 1}; using a range object will use the tile at the specified location for the reference diob
3440
- * @param {string} pType - type or parent type of diobs to get
3441
- * @param {boolean} pChild - true to include all child diobs; false to include only diobs with the exact type of pType
3442
- * @param {boolean} pOmit - either x distance or x and y distance
3443
- * @returns {Diob[]} returns an array containing all the non-tile diobs on the map within x and y tiles around the specified diob that have the same type as pType or a parent type of pType if pChild is enabled
3444
- */
3445
- getTileRangeByType(pO: Diob | Object, pType: string, pChild: boolean, pOmit: boolean): Diob[]
3446
-
3447
- /**
3448
- * returns an array containing all the non-tile diobs on the map within x and y positional units around the specified diob that are able to see the diob and that have the same type as pType or a parent type of pType if pChild is enabled
3449
- * @env Client | Server
3450
- * @param {Diob | Object} pO - diob or range object to get range from; range object example {'map': 'name', 'x': 1, 'y': 1}; using a range object will use the tile at the specified location for the reference diob
3451
- * @param {string} pType - type or parent type of diobs to get
3452
- * @param {boolean} pChild - true to include all child diobs; false to include only diobs with the exact type of pType
3453
- * @param {boolean} pOmit - either x distance or x and y distance
3454
- * @returns {Diob[]} returns an array containing all the non-tile diobs on the map within x and y positional units around the specified diob that are able to see the diob and that have the same type as pType or a parent type of pType if pChild is enabled
3455
- */
3456
- getRangeViewersByType(pO: Diob | Object, pType: string, pChild: boolean, pOmit: boolean): Diob[]
3457
-
3458
- /**
3459
- * returns an array active clients that have player mobs on the map pMap
3460
- * @env Client | Server
3461
- * @param {string} pMap - name of the map to get clients from
3462
- * @returns {Client[]} returns an array active clients that have player mobs on the map pMap
3463
- */
3464
- getClients(pMap: string): Client[]
3465
-
3466
- /**
3467
- * returns the region based on the type pType
3468
- * @env Client | Server
3469
- * @param {string} pType - type of the region to grab
3470
- * @returns {Diob} returns the region based on the type pType
3471
- */
3472
- getRegionByType(pType: string): Diob
3473
-
3474
- /**
3475
- * returns an array containing all the non-tile diobs on the map within x and y tiles around the specified diob that are visible by the diob and that have the same type as pType or a parent type of pType if pChild is enabled
3476
- * @env Client | Server
3477
- * @param {Diob | Object} pO - diob or range object to get range from; range object example {'map': 'name', 'x': 1, 'y': 1}; using a range object will use the tile at the specified location for the reference diob
3478
- * @param {string} pType - type or parent type of diobs to get
3479
- * @param {boolean} pChild - true to include all child diobs; false to include only diobs with the exact type of pType
3480
- * @param {boolean} pOmit - either x distance or x and y distance
3481
- * @returns {Diob[]} returns an array containing all the non-tile diobs on the map within x and y tiles around the specified diob that are visible by the diob and that have the same type as pType or a parent type of pType if pChild is enabled
3482
- */
3483
- getTileRangeViewByType(pO: Diob | Object, pType: string, pChild: boolean, pOmit: boolean): Diob[]
3484
-
3485
- /**
3486
- * sets the Region at pLoc to pR and returns the Region
3487
- * @env Client | Server
3488
- * @param {Diob | Object} pLoc - either a Tile reference or an object containing location information; ex {'xCoord': 1, 'yCoord': 1, 'mapName': 'map'}
3489
- * @param {string} pR - either a type string containing the type of a new Region or a reference to a Region
3490
- * @returns {Diob} returns the Region
3491
- */
3492
- setRegion(pLoc: Diob | Object, pR: string): Diob
3493
-
3494
- /**
3495
- * returns an array of diobs on the map and screen depending on the provided arguments; if pType is not set, all map diobs on the screen will be returned; if pType is set but pChild is not, map diobs on the screen 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 map mobs on the screen will be returned
3496
- * @env Client
3497
- * @param {string} [pType] - optional; string containing type path to return
3498
- * @param {boolean} [pChild] - optional; boolean that determines if child types are included
3499
- * @param {Diob[]} [pAdd] - optional; if set, tiles and regions on the screen will also be returned
3500
- * @returns {Diob[]} returns an array of diobs on the map and screen depending on the provided arguments; if pType is not set, all map diobs on the screen will be returned; if pType is set but pChild is not, map diobs on the screen 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 map mobs on the screen will be returned
3501
- */
3502
- getScreenDiobs(pType?: string, pChild?: boolean, pAdd?: Diob[]): Diob[]
3503
-
3504
- /**
3505
- * returns the direction string if pD.dir was rotated by pAngle radians; set pD to {'dir': 'east'} to find the raw direction from a raw angle, defaults to east if nothing passed in
3506
- * @env Client | Server
3507
- * @param {Diob} [pD] - optional; reference to diob or direction object; ex {'dir': 'east'}
3508
- * @param {number} [pAngle] - optional; angle in radians
3509
- * @returns {string} returns the direction string if pD.dir was rotated by pAngle radians; set pD to {'dir': 'east'} to find the raw direction from a raw angle, defaults to east if nothing passed in
3510
- */
3511
- getDirByAngle(pD?: Diob, pAngle?: number): string
3512
-
3513
- /**
3514
- * creates a new map with the name pName and a size of pX, pY
3515
- * @env Client | Server
3516
- * @param {string} pName - unique name of the map
3517
- * @param {number} pX - amount of tiles on the x-axis
3518
- * @param {number} pY - amount of tiles on the y-axis
3519
- * @param {string} pTile - tile object type to use as the default tiles
3520
- */
3521
- createMap(pName: string, pX: number, pY: number, pTile: string): void
3522
-
3523
- /**
3524
- * sends the data for the pD diob to all clients on the pMap map, if pVar is set it will send only those variables, if it is not set it will only send built-in engine variables
3525
- * @env Server
3526
- * @param {string} pMap - name of the map
3527
- * @param {Diob} pD - reference to the diob to send
3528
- * @param {any[]} [pVar] - optional; variable name or array of variable names
3529
- */
3530
- sendDiob(pMap: string, pD: Diob, pVar?: any[]): void
3531
-
3532
- /**
3533
- * returns an array containing all the non-tile diobs on the map within x and y positional units around the specified diob that are visible to the diob
3534
- * @env Client | Server
3535
- * @param {Diob | Object} pO - diob or range object to get range from; range object example {'map': 'name', 'x': 1, 'y': 1}; using a range object will use the tile at the specified location for the reference diob
3536
- * @param {boolean} pOmit - either x distance or x and y distance
3537
- * @returns {Diob[]} returns an array containing all the non-tile diobs on the map within x and y positional units around the specified diob that are visible to the diob
3538
- */
3539
- getRangeView(pO: Diob | Object, pOmit: boolean): Diob[]
3540
-
3541
- /**
3542
- * returns an array containing all the non-tile diobs on the map within x and y tiles around the specified diob
3543
- * @env Client | Server
3544
- * @param {Diob | Object} pO - diob or range object to get range from; range object example {'map': 'name', 'x': 1, 'y': 1}; using a range object will use the tile at the specified location for the reference diob
3545
- * @param {boolean} pOmit - either x distance or x and y distance
3546
- * @returns {Diob[]} returns an array containing all the non-tile diobs on the map within x and y tiles around the specified diob
3547
- */
3548
- getTileRange(pO: Diob | Object, pOmit: boolean): Diob[]
3549
-
3550
- /**
3551
- * returns an object {'x': x, 'y': y, 'xPos': xPos, 'yPos': yPos} containing the number of x and y tiles on the map and the physical size of the map
3552
- * @env Client | Server
3553
- * @param {string} pMap - name of the map to get the size of
3554
- * @returns {{'x': number, 'y': number, 'xPos': number, 'yPos': number}} returns an object {'x': x, 'y': y, 'xPos': xPos, 'yPos': yPos} containing the number of x and y tiles on the map and the physical size of the map
3555
- */
3556
- getMapSize(pMap: string): {'x': number, 'y': number, 'xPos': number, 'yPos': number}
3557
-
3558
- }
3559
-
3560
-
3561
- type Macro = {
3562
-
3563
- /**
3564
- * creates a new blank macro atlas named pName
3565
- * @env Client | Server
3566
- * @param {string} pName - name of the new macro atlas
3567
- */
3568
- newMacroAtlas(pName: string): void
3569
-
3570
- /**
3571
- * creates a new macro with the keyUp command pUp, and keyDown command pDown, and the name pName and adds it to the macro atlas pAtlas
3572
- * @env Client | Server
3573
- * @param {string} pName - name of the macro to create
3574
- * @param {string} pAtlas - name of the macro atlas to add the new macro to
3575
- * @param {string} pKey - string of key that will execute this macro
3576
- * @param {string} [pDown] - optional; string containing the command to execute when the key is pushed down; example 'test(1)' would execute the client command 'test' with one parameter that is equal to '1'
3577
- * @param {string} [pUp] - optional; string containing the command to execute when the key is let go of; example 'test(1)' would execute the client command 'test' with one parameter that is equal to '1'
3578
- */
3579
- newMacro(pName: string, pAtlas: string, pKey: string, pDown?: string, pUp?: string): void
3580
-
3581
- /**
3582
- * returns an array containing the names of all the macros in the macro atlas pAtlas
3583
- * @env Client | Server
3584
- * @param {string} pAtlas - name of the macro atlas
3585
- * @returns {string[]} returns an array containing the names of all the macros in the macro atlas pAtlas
3586
- */
3587
- getMacroNames(pAtlas: string): string[]
3588
-
3589
- /**
3590
- * returns an array containing the names of all the currently loaded macro atlases
3591
- * @env Client | Server
3592
- * @returns {string[]} returns an array containing the names of all the currently loaded macro atlases
3593
- */
3594
- getMacroAtlasNames(): string[]
3595
-
3596
- /**
3597
- * removes the macro pName from the macro atlas pAtlas
3598
- * @env Client | Server
3599
- * @param {string} pName - name of the macro to remove
3600
- * @param {string} pAtlas - name of the macro atlas to remove the macro from
3601
- */
3602
- removeMacro(pName: string, pAtlas: string): void
3603
-
3604
- }
3605
-
3606
-
3607
- type Type = {
3608
-
3609
- /**
3610
- * returns an object containing all the default variables belonging to the type pType
3611
- * @env Client | Server
3612
- * @param {string} pType - type to get variables of
3613
- * @param {any} [pAll] - optional; if set every variable this type has will be returned, if false only variables belonging directly to this type will be returned
3614
- * @returns {any[]} returns an object containing all the default variables belonging to the type pType
3615
- */
3616
- getVariables(pType: string, pAll?: any): any[]
3617
-
3618
- /**
3619
- * returns the default value of the pVar variable belonging to the type pType
3620
- * @env Client | Server
3621
- * @param {string} pType - type to get variable of
3622
- * @param {any} pVar - name of the variable to get
3623
- * @param {any} [pOwn] - optional; if set the returned value will be undefined if the variable belongs to an inherited object
3624
- * @returns {any} returns the default value of the pVar variable belonging to the type pType
3625
- */
3626
- getVariable(pType: string, pVar: any, pOwn?: any): any
3627
-
3628
- /**
3629
- * sets the type pType's default variables specified within the pVars object; example {'a': 1, 'b': 2} would set this type's 'a' and 'b' variables respectively
3630
- * @env Client | Server
3631
- * @param {string} pType - type to set variables for
3632
- * @param {object} pVars - object containing new variables and their values
3633
- */
3634
- setVariables(pType: string, pVars: object): void
3635
-
3636
- /**
3637
- * makes the type pType inherit from the type pInherit; this change only works for newly created objects, objects already in existence will not change
3638
- * @env Client | Server
3639
- * @param {string} pType - type to add inheritance to
3640
- * @param {any} pInherit - type to inherit from
3641
- */
3642
- addInheritance(pType: string, pInherit: any): void
3643
-
3644
- /**
3645
- * creates a new type called pType
3646
- * @env Client | Server
3647
- * @param {string} pType - type to create
3648
- */
3649
- newType(pType: string): void
3650
-
3651
- /**
3652
- * returns the default value of the pName function belonging to the type pType
3653
- * @env Client | Server
3654
- * @param {string} pType - type to get function of
3655
- * @param {string} pName - name of the function to get
3656
- * @returns {Function} returns the default value of the pName function belonging to the type pType
3657
- */
3658
- getFunction(pType: string, pName: string): Function
3659
-
3660
- /**
3661
- * returns an array of the type pType custom inheritances
3662
- * @env Client | Server
3663
- * @param {string} pType - type to get inheritances of
3664
- * @returns {string[]} returns an array of the type pType custom inheritances
3665
- */
3666
- getInheritances(pType: string): string[]
3667
-
3668
- /**
3669
- * sets the pVal value of the pVar static variable belonging to the type pType; static variables are variables that belong to all Objects of this type collectively and are different than normal variables, usually static variables can only be set once, but VyScript static variables may be changed if that is what the developer wants; these variables are not inherited by child types
3670
- * @env Client | Server
3671
- * @param {string} pType - type to set static variable of
3672
- * @param {any} pVar - name of the static variable to set
3673
- * @param {boolean} pVal - value to give to the static variable
3674
- */
3675
- setStaticVariable(pType: string, pVar: any, pVal: boolean): void
3676
-
3677
- /**
3678
- * sets the type pType's pName function to pFunc; this change only works for newly created objects, objects already in existence will not change
3679
- * @env Client | Server
3680
- * @param {string} pType - type to set function for
3681
- * @param {string} pName - string containing the name of the function
3682
- * @param {Function} pFunc - function
3683
- */
3684
- setFunction(pType: string, pName: string, pFunc: Function): void
3685
-
3686
- /**
3687
- * returns the static variable value belonging to the type pType
3688
- * @env Client | Server
3689
- * @param {string} pType - type to get static variable of
3690
- * @param {any} pVar - name of the static variable to get
3691
- * @returns {any} returns the static variable value belonging to the type pType
3692
- */
3693
- getStaticVariable(pType: string, pVar: any): any
3694
-
3695
- /**
3696
- * returns an array of all Object types in the game; if pParent is set, only child types of pParent are returned
3697
- * @env Client | Server
3698
- * @param {any} [pParent] - optional; parent type to start with
3699
- * @param {boolean} [pOmit] - optional; if set will not return the included path, only the children
3700
- * @returns {string[]} returns an array of all Object types in the game; if pParent is set, only child types of pParent are returned
3701
- */
3702
- getTypes(pParent?: any, pOmit?: boolean): string[]
3703
-
3704
- /**
3705
- * removes the inheritance pInherit from the type pType; this change only works for newly created objects, objects already in existence will not change
3706
- * @env Client | Server
3707
- * @param {string} pType - type to remove inheritance from
3708
- * @param {any} pInherit - type of inheritance
3709
- */
3710
- removeInheritance(pType: string, pInherit: any): void
3711
-
3712
- /**
3713
- * calls the function pFunc attached to the type pType as if the function belonged to the object pDiob using the arguments pArgs
3714
- * @env Client | Server
3715
- * @param {string} pType - type to call function of
3716
- * @param {Function} pFunc - name of function to call
3717
- * @param {Diob} pDiob - array of arguments to pass in
3718
- * @param {any[]} pArgs - calls the function pFunc attached to the type pType as if the function belonged to the object pDiob using the arguments pArgs
3719
- */
3720
- callFunction(pType: string, pFunc: Function, pDiob: Diob, pArgs: any[]): void
3721
-
3722
- /**
3723
- * checks to see if pType is a valid type that exists in the game; if pType2 is defined, checks if pType is pType2 or a child of pType2
3724
- * @env Client | Server
3725
- * @param {string} pType - type to check
3726
- */
3727
- isType(pType: string): boolean
3728
-
3729
- }
3730
-
3731
-
3732
- type VyloType = {
3733
-
3734
- World: World
3735
- Client: Client
3736
- Resource: Resource
3737
- Util: Util
3738
- Event: Event
3739
- File: File
3740
- Icon: Icon
3741
- Map: Map
3742
- Type: Type
3743
-
3744
- /**
3745
- * The global object referencing all global variables in VyScript.
3746
- * @env Client | Server
3747
- */
3748
- global: {}
3749
-
3750
- /**
3751
- * Loads the engine. When using loadResource before this is called, the resources will be treated as preloaded resources.
3752
- * @env Client | Server
3753
- * @returns {Promise<void>}
3754
- */
3755
- load: () => Promise<void>;
3756
-
3757
- /**
3758
- * Deletes the Diob referenced by pDiob.
3759
- * @env Client | Server
3760
- * @param {Diob} pDiob - A reference to the Diob to delete.
3761
- * @param {...any[]} [pArgN - Optional parameters to pass as arguments into the Diob's onDel() event function.
3762
- * @template T - The type of additional arguments.
3763
- * @returns {void}
3764
- */
3765
- delDiob: <T = any>(pDiob: Diob, ...pArgN: T[]) => void;
3766
-
3767
- /**
3768
- * Creates a new Diob with the specified Object type of pType and returns it.
3769
- * @env Client | Server
3770
- * @param pType - A string containing the type path of the Object to be created as a Diob.
3771
- * @param {...any[]} [pArgN] - optional; Parameters to pass as arguments into the Diob's onNew() event function.
3772
- * @template T - The type of additional arguments.
3773
- * @returns {Diob} - The newly created Diob.
3774
- */
3775
- newDiob: <T = any>(pType: string, ...pArgN: T[]) => Diob;
3776
-
3777
- /**
3778
- * Creates a new type called pType.
3779
- * @env Client | Server
3780
- * @param {string} pType - Type to alter /create.
3781
- * @param {object} [pVars] - optional; object containing variables to give the type.
3782
- * @param {string[]} [pInherits] - optional; array of type strings to inherit.
3783
- * @returns {void}
3784
- */
3785
- setType: (pType: string, pVars: object, pInherits?: string[]) => void
3786
-
3787
- }
3788
-
3789
- }
3790
- export {};