-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDocsLibs.json
2376 lines (2376 loc) · 102 KB
/
DocsLibs.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
[
{
"name": "lume",
"author": "rxi",
"url": "https://github.com/rxi/lume",
"description": "A collection of functions for Lua, geared towards game development.",
"api": [
{
"name": "clamp",
"arguments": "x, min, max",
"description": "Returns the number `x` clamped between the numbers `min` and `max`"
},
{
"name": "round",
"arguments": "x [, increment]",
"description": "Rounds `x` to the nearest integer; rounds away from zero if we're midway between two integers. If `increment` is set then the number is rounded to the nearest increment.",
"example": "lume.round(2.3) -- Returns 2\nlume.round(123.4567, .1) -- Returns 123.5"
},
{
"name": "sign",
"arguments": "x",
"description": "Returns `1` if `x` is 0 or above, returns `-1` when `x` is negative."
},
{
"name": "lerp",
"arguments": "a, b, amount",
"description": "Returns the linearly interpolated number between `a` and `b`, `amount` should be in the range of 0 - 1; if `amount` is outside of this range it is clamped.",
"example": "lume.lerp(100, 200, .5) -- Returns 150"
},
{
"name": "smooth",
"arguments": "a, b, amount",
"description": "Similar to `lume.lerp()` but uses cubic interpolation instead of linear interpolation."
},
{
"name": "pingpong",
"arguments": "x",
"description": "Ping-pongs the number `x` between 0 and 1."
},
{
"name": "distance",
"arguments": "x1, y1, x2, y2 [, squared]",
"description": "Returns the distance between the two points. If `squared` is true then the squared distance is returned -- this is faster to calculate and can still be used when comparing distances."
},
{
"name": "angle",
"arguments": "x1, y1, x2, y2",
"description": "Returns the angle between the two points."
},
{
"name": "vector",
"arguments": "angle, magnitude",
"description": "Given an `angle` and `magnitude`, returns a vector.",
"example": "local x, y = lume.vector(0, 10) -- Returns 10, 0"
},
{
"name": "random",
"arguments": "[a [, b]]",
"description": "Returns a random number between `a` and `b`. If only `a` is supplied a number between `0` and `a` is returned. If no arguments are supplied a random number between `0` and `1` is returned."
},
{
"name": "randomchoice",
"arguments": "t",
"description": "Returns a random value from array `t`. If the array is empty an error is raised.",
"example": "lume.randomchoice({true, false}) -- Returns either true or false"
},
{
"name": "weightedchoice",
"arguments": "t",
"description": "Takes the argument table `t` where the keys are the possible choices and the value is the choice's weight. A weight should be 0 or above, the larger the number the higher the probability of that choice being picked. If the table is empty, a weight is below zero or all the weights are 0 then an error is raised.",
"example": "lume.weightedchoice({ [\"cat\"] = 10, [\"dog\"] = 5, [\"frog\"] = 0 })\n-- Returns either \"cat\" or \"dog\" with \"cat\" being twice as likely to be chosen."
},
{
"name": "isarray",
"arguments": "x",
"description": "Returns `true` if `x` is an array -- the value is assumed to be an array if it is a table which contains a value at the index `1`. This function is used internally and can be overridden if you wish to use a different method to detect arrays."
},
{
"name": "push",
"arguments": "t, ...",
"description": "Pushes all the given values to the end of the table `t` and returns the pushed values. Nil values are ignored.",
"example": "local t = { 1, 2, 3 }\nlume.push(t, 4, 5) -- `t` becomes { 1, 2, 3, 4, 5 }"
},
{
"name": "remove",
"arguments": "t, x",
"description": "Removes the first instance of the value `x` if it exists in the table `t`. Returns `x`.",
"example": "local t = { 1, 2, 3 }\nlume.remove(t, 2) -- `t` becomes { 1, 3 }"
},
{
"name": "clear",
"arguments": "t",
"description": "Nils all the values in the table `t`, this renders the table empty. Returns `t`.",
"example": "local t = { 1, 2, 3 }\nlume.clear(t) -- `t` becomes {}"
},
{
"name": "extend",
"arguments": "t, ...",
"description": "Copies all the fields from the source tables to the table `t` and returns `t`. If a key exists in multiple tables the right-most table's value is used.",
"example": "local t = { a = 1, b = 2 }\nlume.extend(t, { b = 4, c = 6 }) -- `t` becomes { a = 1, b = 4, c = 6 }"
},
{
"name": "shuffle",
"arguments": "t",
"description": "Returns a shuffled copy of the array `t`."
},
{
"name": "sort",
"arguments": "t [, comp]",
"description": "Returns a copy of the array `t` with all its items sorted. If `comp` is a function it will be used to compare the items when sorting. If `comp` is a string it will be used as the key to sort the items by.",
"example": "lume.sort({ 1, 4, 3, 2, 5 }) -- Returns { 1, 2, 3, 4, 5 }\nlume.sort({ {z=2}, {z=3}, {z=1} }, \"z\") -- Returns { {z=1}, {z=2}, {z=3} }\nlume.sort({ 1, 3, 2 }, function(a, b) return a > b end) -- Returns { 3, 2, 1 }"
},
{
"name": "array",
"arguments": "...",
"description": "Iterates the supplied iterator and returns an array filled with the values.",
"example": "lume.array(string.gmatch(\"Hello world\", \"%a+\")) -- Returns {\"Hello\", \"world\"}"
},
{
"name": "each",
"arguments": "t, fn, ...",
"description": "Iterates the table `t` and calls the function `fn` on each value followed by the supplied additional arguments; if `fn` is a string the method of that name is called for each value. The function returns `t` unmodified.",
"example": "lume.each({1, 2, 3}, print) -- Prints \"1\", \"2\", \"3\" on separate lines\nlume.each({a, b, c}, \"move\", 10, 20) -- Does x:move(10, 20) on each value"
},
{
"name": "map",
"arguments": "t, fn",
"description": "Applies the function `fn` to each value in table `t` and returns a new table with the resulting values.",
"example": "lume.map({1, 2, 3}, function(x) return x * 2 end) -- Returns {2, 4, 6}"
},
{
"name": "all",
"arguments": "t [, fn]",
"description": "Returns true if all the values in `t` table are true. If a `fn` function is supplied it is called on each value, true is returned if all of the calls to `fn` return true.",
"example": "lume.all({1, 2, 1}, function(x) return x == 1 end) -- Returns false"
},
{
"name": "any",
"arguments": "t [, fn]",
"description": "Returns true if any of the values in `t` table are true. If a `fn` function is supplied it is called on each value, true is returned if any of the calls to `fn` return true.",
"example": "lume.any({1, 2, 1}, function(x) return x == 1 end) -- Returns true"
},
{
"name": "reduce",
"arguments": "t, fn [, first]",
"description": "Applies `fn` on two arguments cumulative to the items of the array `t`, from left to right, so as to reduce the array to a single value. If a `first` value is specified the accumulator is initialised to this, otherwise the first value in the array is used. If the array is empty and no `first` value is specified an error is raised.",
"example": "lume.reduce({1, 2, 3}, function(a, b) return a + b end) -- Returns 6"
},
{
"name": "unique",
"arguments": "t",
"description": "Returns a copy of the `t` array with all the duplicate values removed.",
"example": "lume.unique({2, 1, 2, \"cat\", \"cat\"}) -- Returns {1, 2, \"cat\"}"
},
{
"name": "filter",
"arguments": "t, fn [, retainkeys]",
"description": "Calls `fn` on each value of `t` table. Returns a new table with only the values where `fn` returned true. If `retainkeys` is true the table is not treated as an array and retains its original keys.",
"example": "lume.filter({1, 2, 3, 4}, function(x) return x % 2 == 0 end) -- Returns {2, 4}"
},
{
"name": "reject",
"arguments": "t, fn [, retainkeys]",
"description": "The opposite of `lume.filter()`: Calls `fn` on each value of `t` table; returns a new table with only the values where `fn` returned false. If `retainkeys` is true the table is not treated as an array and retains its original keys.",
"example": "lume.reject({1, 2, 3, 4}, function(x) return x % 2 == 0 end) -- Returns {1, 3}"
},
{
"name": "merge",
"arguments": "...",
"description": "Returns a new table with all the given tables merged together. If a key exists in multiple tables the right-most table's value is used.",
"example": "lume.merge({a=1, b=2, c=3}, {c=8, d=9}) -- Returns {a=1, b=2, c=8, d=9}"
},
{
"name": "concat",
"arguments": "...",
"description": "Returns a new array consisting of all the given arrays concatenated into one.",
"example": "lume.concat({1, 2}, {3, 4}, {5, 6}) -- Returns {1, 2, 3, 4, 5, 6}"
},
{
"name": "find",
"arguments": "t, value",
"description": "Returns the index/key of `value` in `t`. Returns `nil` if that value does not exist in the table.",
"example": "lume.find({\"a\", \"b\", \"c\"}, \"b\") -- Returns 2"
},
{
"name": "match",
"arguments": "t, fn",
"description": "Returns the value and key of the value in table `t` which returns true when `fn` is called on it. Returns `nil` if no such value exists.",
"example": "lume.match({1, 5, 8, 7}, function(x) return x % 2 == 0 end) -- Returns 8, 3"
},
{
"name": "count",
"arguments": "t [, fn]",
"description": "Counts the number of values in the table `t`. If a `fn` function is supplied it is called on each value, the number of times it returns true is counted.",
"example": "lume.count({a = 2, b = 3, c = 4, d = 5}) -- Returns 4\nlume.count({1, 2, 4, 6}, function(x) return x % 2 == 0 end) -- Returns 3"
},
{
"name": "slice",
"arguments": "t [, i [, j]]",
"description": "Mimics the behaviour of Lua's `string.sub`, but operates on an array rather than a string. Creates and returns a new array of the given slice.",
"example": "lume.slice({\"a\", \"b\", \"c\", \"d\", \"e\"}, 2, 4) -- Returns {\"b\", \"c\", \"d\"}"
},
{
"name": "first",
"arguments": "t [, n]",
"description": "Returns the first element of an array or nil if the array is empty. If `n` is specificed an array of the first `n` elements is returned.",
"example": "lume.first({\"a\", \"b\", \"c\"}) -- Returns \"a\""
},
{
"name": "last",
"arguments": "t [, n]",
"description": "Returns the last element of an array or nil if the array is empty. If `n` is specificed an array of the last `n` elements is returned.",
"example": "lume.last({\"a\", \"b\", \"c\"}) -- Returns \"c\""
},
{
"name": "invert",
"arguments": "t",
"description": "Returns a copy of the table where the keys have become the values and the values the keys.",
"example": "lume.invert({a = \"x\", b = \"y\"}) -- returns {x = \"a\", y = \"b\"}"
},
{
"name": "pick",
"arguments": "t, ...",
"description": "Returns a copy of the table filtered to only contain values for the given keys.",
"example": "lume.pick({ a = 1, b = 2, c = 3 }, \"a\", \"c\") -- Returns { a = 1, c = 3 }"
},
{
"name": "keys",
"arguments": "t",
"description": "Returns an array containing each key of the table."
},
{
"name": "clone",
"arguments": "t",
"description": "Returns a shallow copy of the table `t`."
},
{
"name": "fn",
"arguments": "fn, ...",
"description": "Creates a wrapper function around function `fn`, automatically inserting the arguments into `fn` which will persist every time the wrapper is called. Any arguments which are passed to the returned function will be inserted after the already existing arguments passed to `fn`.",
"example": "local f = lume.fn(print, \"Hello\")\nf(\"world\") -- Prints \"Hello world\""
},
{
"name": "once",
"arguments": "fn, ...",
"description": "Returns a wrapper function to `fn` which takes the supplied arguments. The wrapper function will call `fn` on the first call and do nothing on any subsequent calls.",
"example": "local f = lume.once(print, \"Hello\")\nf() -- Prints \"Hello\"f() -- Does nothing"
},
{
"name": "memoize",
"arguments": "fn",
"description": "Returns a wrapper function to `fn` where the results for any given set of arguments are cached. `lume.memoize()` is useful when used on functions with slow-running computations.",
"example": "fib = lume.memoize(function(n) return n < 2 and n or fib(n-1) + fib(n-2) end)"
},
{
"name": "combine",
"arguments": "...",
"description": "Creates a wrapper function which calls each supplied argument in the order they were passed to `lume.combine()`; nil arguments are ignored. The wrapper function passes its own arguments to each of its wrapped functions when it is called.",
"example": "local f = lume.combine(function(a, b) print(a + b) end,\n function(a, b) print(a * b) end)\nf(3, 4) -- Prints \"7\" then \"12\" on a new line"
},
{
"name": "call",
"arguments": "fn, ...",
"description": "Calls the given function with the provided arguments and returns its values. If `fn` is `nil` then no action is performed and the function returns `nil`.",
"example": "lume.call(print, \"Hello world\") -- Prints \"Hello world\""
},
{
"name": "time",
"arguments": "fn, ...",
"description": "Inserts the arguments into function `fn` and calls it. Returns the time in seconds the function `fn` took to execute followed by `fn`'s returned values.",
"example": "lume.time(function(x) return x end, \"hello\") -- Returns 0, \"hello\""
},
{
"name": "lambda",
"arguments": "str",
"description": "Takes a string lambda and returns a function. `str` should be a list of comma-separated parameters, followed by `->`, followed by the expression which will be evaluated and returned.",
"example": "local f = lume.lambda \"x,y -> 2*x+y\"\nf(10, 5) -- Returns 25"
},
{
"name": "serialize",
"arguments": "x",
"description": "Serializes the argument `x` into a string which can be loaded again using `lume.deserialize()`. Only booleans, numbers, tables and strings can be serialized. Circular references will result in an error; all nested tables are serialized as unique tables.",
"example": "lume.serialize({a = \"test\", b = {1, 2, 3}, false})\n-- Returns \"{[1]=false,[\"a\"]=\"test\",[\"b\"]={[1]=1,[2]=2,[3]=3,},}\""
},
{
"name": "deserialize",
"arguments": "str",
"description": "Deserializes a string created by `lume.serialize()` and returns the resulting value. This function should not be run on an untrusted string.",
"example": "lume.deserialize(\"{1, 2, 3}\") -- Returns {1, 2, 3}"
},
{
"name": "split",
"arguments": "str [, sep]",
"description": "Returns an array of the words in the string `str`. If `sep` is provided it is used as the delimiter, consecutive delimiters are not grouped together and will delimit empty strings.",
"example": "lume.split(\"One two three\") -- Returns {\"One\", \"two\", \"three\"}"
},
{
"name": "trim",
"arguments": "str [, chars]",
"description": "Trims the whitespace from the start and end of the string `str` and returns the new string. If a `chars` value is set the characters in `chars` are trimmed instead of whitespace.",
"example": "lume.trim(\" Hello \") -- Returns \"Hello\""
},
{
"name": "wordwrap",
"arguments": "str [, limit]",
"description": "Returns `str` wrapped to `limit` number of characters per line, by default `limit` is `72`. `limit` can also be a function which when passed a string, returns `true` if it is too long for a single line.",
"example": "-- Returns \"Hello world\nThis is a\nshort string\"\nlume.wordwrap(\"Hello world. This is a short string\", 14)"
},
{
"name": "format",
"arguments": "str [, vars]",
"description": "Returns a formatted string. The values of keys in the table `vars` can be inserted into the string by using the form `\"{key}\"` in `str`; numerical keys can also be used.",
"example": "lume.format(\"{b} hi {a}\", {a = \"mark\", b = \"Oh\"}) -- Returns \"Oh hi mark\"\nlume.format(\"Hello {1}!\", {\"world\"}) -- Returns \"Hello world!\""
},
{
"name": "trace",
"arguments": "...",
"description": "Prints the current filename and line number followed by each argument separated by a space.",
"example": "-- Assuming the file is called \"example.lua\" and the next line is 12:\nlume.trace(\"hello\", 1234) -- Prints \"example.lua:12: hello 1234\""
},
{
"name": "dostring",
"arguments": "str",
"description": "Executes the lua code inside `str`.",
"example": "lume.dostring(\"print('Hello!')\") -- Prints \"Hello!\""
},
{
"name": "uuid",
"arguments": "",
"description": "Generates a random UUID string; version 4 as specified in [RFC 4122](http://www.ietf.org/rfc/rfc4122.txt)."
},
{
"name": "hotswap",
"arguments": "modname",
"description": "Reloads an already loaded module in place, allowing you to immediately see the effects of code changes without having to restart the program. `modname` should be the same string used when loading the module with require(). In the case of an error the global environment is restored and `nil` plus an error message is returned.",
"example": "lume.hotswap(\"lume\") -- Reloads the lume module\nassert(lume.hotswap(\"inexistant_module\")) -- Raises an error"
},
{
"name": "ripairs",
"arguments": "t",
"description": "Performs the same function as `ipairs()` but iterates in reverse; this allows the removal of items from the table during iteration without any items being skipped.",
"example": "-- Prints \"3->c\", \"2->b\" and \"1->a\" on separate lines\nfor i, v in lume.ripairs({ \"a\", \"b\", \"c\" }) do\n print(i .. \"->\" .. v)\nend"
},
{
"name": "color",
"arguments": "str [, mul]",
"description": "Takes color string `str` and returns 4 values, one for each color channel (`r`, `g`, `b` and `a`). By default the returned values are between 0 and 1; the values are multiplied by the number `mul` if it is provided.",
"example": "lume.color(\"#ff0000\") -- Returns 1, 0, 0, 1\nlume.color(\"rgba(255, 0, 255, .5)\") -- Returns 1, 0, 1, .5\nlume.color(\"#00ffff\", 256) -- Returns 0, 256, 256, 256\nlume.color(\"rgb(255, 0, 0)\", 256) -- Returns 256, 0, 0, 256"
},
{
"name": "chain",
"arguments": "value",
"description": "Returns a wrapped object which allows chaining of lume functions. The function result() should be called at the end of the chain to return the resulting value.",
"example": "lume.chain({1, 2, 3, 4})\n :filter(function(x) return x % 2 == 0 end)\n :map(function(x) return -x end)\n :result() -- Returns { -2, -4 }"
}
]
},
{
"name": "batteries",
"author": "1bardesign",
"url": "https://github.com/1bardesign/batteries",
"description": "batteries fills out lua's sparse standard library a little, and provides implementations of common algorithms and data structures useful for games.",
"api": [
{
"name": "assert:some",
"arguments": "v, msg, stack_level",
"description": "assert a value is not nil, returns the value"
},
{
"name": "assert:equal",
"arguments": "a, b, msg, stack_level",
"description": "assert two values are equal"
},
{
"name": "assert:not_equal",
"arguments": "a, b, msg, stack_level",
"description": "assert two values are not equal"
},
{
"name": "assert:type",
"arguments": "a, t, msg, stack_level",
"description": "assert a value is of a certain type"
},
{
"name": "assert:nop",
"arguments": "",
"description": "Replace everything in assert with nop functions that just return their second argument, for near-zero overhead on release"
},
{
"name": "mathx.wrap",
"arguments": "v, lo, hi",
"description": "Wrap v around range [lo, hi]"
},
{
"name": "mathx.wrap_index",
"arguments": "i, t",
"description": "Wrap i around the indices of t"
},
{
"name": "mathx.clamp",
"arguments": "v, lo, hi",
"description": "Clamp v to range [lo, hi]"
},
{
"name": "mathx.clamp01",
"arguments": "v",
"description": "Clamp v to range [0, 1]"
},
{
"name": "mathx.round",
"arguments": "v",
"description": "Round v to nearest whole, away from zero"
},
{
"name": "mathx.to_one_in",
"arguments": "v, x",
"description": "Round v to one-in x"
},
{
"name": "mathx.to_precision",
"arguments": "v, decimal_points",
"description": "Round v to a given decimal precision"
},
{
"name": "mathx.sign",
"arguments": "v",
"description": "0, 1, -1 sign of a scalar"
},
{
"name": "mathx.lerp",
"arguments": "a, b, t",
"description": "Linear interpolation between a and b"
},
{
"name": "mathx.lerp_eps",
"arguments": "a, b, t, eps",
"description": "Linear interpolation with a minimum \"final step\" distance\nUseful for making sure dynamic lerps do actually reach their final destination"
},
{
"name": "mathx.bilerp",
"arguments": "a, b, c, d, u, v",
"description": "Bilinear interpolation between 4 samples"
},
{
"name": "mathx.smoothstep",
"arguments": "v",
"description": "Classic smoothstep\n(Only \"safe\" for 0-1 range)"
},
{
"name": "mathx.smootherstep",
"arguments": "v",
"description": "Classic smootherstep; zero 2nd order derivatives at 0 and 1\n(Only safe for 0-1 range)"
},
{
"name": "mathx.random_sign",
"arguments": "_r",
"description": "Return a random sign"
},
{
"name": "mathx.random_lerp",
"arguments": "min, max, _r",
"description": "Return a random value between two numbers (continuous)"
},
{
"name": "mathx.isnan",
"arguments": "v",
"description": "Nan checking"
},
{
"name": "mathx.tau",
"callable": false,
"description": "Superior constant handy for expressing things in turns"
},
{
"name": "mathx.normalise_angle",
"arguments": "a",
"description": "Normalise angle onto the interval [-math.pi, math.pi)\nSo each angle only has a single value representing it"
},
{
"name": "mathx.normalize_angle",
"arguments": "a",
"description": "Normalize angle onto the interval [-math.pi, math.pi)\nSo each angle only has a single value representing it"
},
{
"name": "mathx.angle_difference",
"arguments": "a, b",
"description": "Get the normalised difference between two angles"
},
{
"name": "mathx.lerp_angle",
"arguments": "a, b, t",
"description": "Mathx.lerp equivalent for angles"
},
{
"name": "mathx.lerp_angle_eps",
"arguments": "a, b, t, eps",
"description": "Mathx.lerp_eps equivalent for angles"
},
{
"name": "mathx.rotate",
"arguments": "x, y, r",
"description": "Rotate a point around the origin by an angle"
},
{
"name": "mathx.length",
"arguments": "x, y",
"description": "Get the length of a vector from the origin"
},
{
"name": "mathx.distance",
"arguments": "x1, y1, x2, y2",
"description": "Get the distance between two points"
},
{
"name": "stringx.split",
"arguments": "self, delim",
"description": "Split a string on a delimiter into an ordered table"
},
{
"name": "stringx.trim",
"arguments": "s",
"description": "Trim all whitespace off the head and tail of a string\nSpecifically trims space, tab, newline, and carriage return characters\nIgnores form feeds, vertical tabs, and backspaces"
},
{
"name": "stringx.ltrim",
"arguments": "s",
"description": "Trim the start of a string"
},
{
"name": "stringx.rtrim",
"arguments": "s",
"description": "Trim the end of a string"
},
{
"name": "stringx.deindent",
"arguments": "s, keep_trailing_empty",
"description": "Remove identation from a string"
},
{
"name": "stringx.apply_template",
"arguments": "s, sub",
"description": "Apply a template to a string\nie ('hello $name'):format({name = 'tom'}) == 'hello tom'"
},
{
"name": "stringx.contains",
"arguments": "haystack, needle",
"description": "Check if a given string contains another (without garbage)"
},
{
"name": "stringx.starts_with",
"arguments": "s, prefix",
"description": "Check if a given string starts with another (without garbage)"
},
{
"name": "stringx.ends_with",
"arguments": "s, suffix",
"description": "Check if a given string ends with another (without garbage)"
},
{
"name": "functional.identity",
"arguments": "v",
"description": "The identity function, returns the value"
},
{
"name": "functional.foreach",
"arguments": "t, f",
"description": "Simple sequential iteration, f is called for all elements of t\nf can return non-nil to break the loop (and return the value)"
},
{
"name": "functional.reduce",
"arguments": "t, seed, f",
"description": "Iteratively performs a left to right reduction of t using f, with seed as the initial value"
},
{
"name": "functional.map",
"arguments": "t, f",
"description": "Maps a sequence {a, b, c} -> {f(a), f(b), f(c)}, automatically drops any nils"
},
{
"name": "functional.map_inplace",
"arguments": "t, f",
"description": "Maps a sequence inplace, modifying it {a, b, c} -> {f(a), f(b), f(c)}"
},
{
"name": "functional.filter",
"arguments": "t, f",
"description": "Filters a sequence by returning a table containing items where f(v, i) returns truthy"
},
{
"name": "functional.filter_inplace",
"arguments": "t, f",
"description": "Filters a sequence in place, modifying it"
},
{
"name": "functional.remove_if",
"arguments": "t, f",
"description": "Complement of filter, returns a table containing items where f(v) returns falsey"
},
{
"name": "functional.partition",
"arguments": "t, f",
"description": "Partitions a sequence into two, based on filter criteria, simultaneous filter and remove_if"
},
{
"name": "functional.group_by",
"arguments": "t, f",
"description": "Returns a table where the elements in t are grouped into sequential tables by the result of f on each element"
},
{
"name": "functional.zip",
"arguments": "t1, t2, f",
"description": "Zips two sequences together into a new table, based on another function"
},
{
"name": "functional.stitch",
"arguments": "t, f",
"description": "Maps a sequence {a, b, c} -> collapse { f(a), f(b), f(c) }"
},
{
"name": "functional.cycle",
"arguments": "t, f",
"description": "Maps a sequence {a, b, c} -> { f(a, b), f(b, c), f(c, a) }"
},
{
"name": "functional.generate",
"arguments": "count, f",
"description": "Generate data into a table, basically a map on numeric values from 1 to count"
},
{
"name": "functional.generate_2d",
"arguments": "t, f",
"description": "2d version of generate() but ends up with a 1d table"
},
{
"name": "functional.any",
"arguments": "t, f",
"description": "True if any element of the table matches f"
},
{
"name": "functional.none",
"arguments": "t, f",
"description": "True if no element of the table matches f"
},
{
"name": "functional.all",
"arguments": "t, f",
"description": "True if all elements of the table match f"
},
{
"name": "functional.count",
"arguments": "t, f",
"description": "Counts the elements of t that match f"
},
{
"name": "functional.contains",
"arguments": "t, e",
"description": "True if the table contains element e"
},
{
"name": "functional.sum",
"arguments": "t",
"description": "Return the numeric sum of all elements of t"
},
{
"name": "functional.mean",
"arguments": "t",
"description": "Return the numeric mean of all elements of t"
},
{
"name": "functional.minmax",
"arguments": "t",
"description": "Return the minimum and maximum of t in one pass or zero for both if t is empty"
},
{
"name": "functional.max",
"arguments": "t",
"description": "Return the maximum element of t or zero if t is empty"
},
{
"name": "functional.min",
"arguments": "t",
"description": "Return the minimum element of t or zero if t is empty"
},
{
"name": "functional.find_min",
"arguments": "t, f",
"description": "Return the element of the table that results in the lowest numeric value"
},
{
"name": "functional.find_max",
"arguments": "t, f",
"description": "Return the element of the table that results in the greatest numeric value"
},
{
"name": "functional.find_nearest",
"arguments": "t, f, target",
"description": "Return the element of the table that results in the value nearest to the passed value"
},
{
"name": "functional.find_match",
"arguments": "t, f",
"description": "Return the first element of the table that results in a true filter"
}
]
},
{
"name": "step",
"author": "Sheepolution",
"url": "https://github.com/sheepolution/step",
"description": "A small immediate mode timer module that makes it easier to have an action execute with a certain interval or after a delay.",
"callType": ".",
"api": [
{
"name": "every",
"arguments": "duration [, max_duration]",
"description": "Creates a timer which returns true every `duration` seconds. If `max_duration` is set the duration will be a random float between `duration` and `max_duration` every loop.",
"example": "timer = step.every(3)\nif timer:update(dt) then\n print(\"This will be printed every 3 seconds\")\nend"
},
{
"name": "update",
"arguments": "dt",
"description": "Update the timer with `timer:update(dt)` or by calling your timer (`timer(dt)`) and pass the delta time as argument.",
"example": "if timer(dt) then\n print(\"This will be printed every 3 seconds.\")\nend"
},
{
"name": "after",
"arguments": "duration [, max_duration]",
"description": "Creates a timer which continuously returns true after `duration` seconds. If `max_duration` is set the duration will be a random float between `duration` and `max_duration` every reset.",
"example": "timer = step.after(3)\nif timer:update(dt) then\n print(\"After 3 seconds this will be printed every frame.\")\nend"
},
{
"name": "once",
"arguments": "duration [, max_duration]",
"description": "Creates a timer which returns true once after `duration` seconds. If `max_duration` is set the duration will be a random float between `duration` and `max_duration` every reset.",
"example": "timer = step.once(3)\nif timer:update(dt) then\n print(\"After 3 seconds this will be printed once.\")\nend"
},
{
"name": "during",
"arguments": "duration [, max_duration]",
"description": "Creates a timer which returns true until after `duration` seconds. If `max_duration` is set the duration will be a random float between `duration` and `max_duration` every reset.",
"example": "timer = step.once(3)\nif timer:update(dt) then\n print(\"This will be printed every frame until 3 seconds have passed.\")\nend"
},
{
"name": "reset",
"description": "You can always reset your timer with `timer:reset()` or simply calling your timer without arguments.",
"example": "timer:reset()\ntimer()"
},
{
"name": "set",
"arguments": "t [, noreset]",
"description": "Change the time for this timer. Will also reset the timer unless `noreset` is `true`.",
"example": "timer = step.every(5)\ntimer:set(3) --Now it will loop every 3 seconds instead."
},
{
"name": "finish",
"description": "Set the timer to the end so that on the next update it will return `true` for a `once` and `every` timer.",
"example": "timer = step.new(4.7)\ntimer:finish()\nif timer(dt) then\n print(\"On the first frame this will be printed and then again after 4.7 seconds.\")\nend"
}
]
},
{
"name": "3DreamEngine",
"author": "3dreamengine",
"url": "https://github.com/3dreamengine/3DreamEngine",
"description": "An awesome 3D engine for LÖVE."
},
{
"name": "anim9",
"author": "excessive",
"url": "https://github.com/excessive/anim9",
"description": "3D skeletal animation library (design to be used with IQM and IQE)"
},
{
"name": "Brinevector3D",
"author": "flamendless",
"url": "https://github.com/flamendless/brinevector3D",
"description": "FFI-enabled vector library for 3D (x,y,z)"
},
{
"name": "bump-3dpd",
"author": "oniietzschan",
"url": "https://github.com/oniietzschan/bump-3dpd",
"description": "A 3D collision detection library for Lua."
},
{
"name": "IQE",
"author": "excessive",
"url": "https://github.com/excessive/iqe",
"description": "Inter-Quake Export loader (text)"
},
{
"name": "IQM",
"author": "excessive",
"url": "https://github.com/excessive/iqm-exm",
"description": "Inter-Quake Model loader (binary)"
},
{
"name": "love-gltf",
"author": "Alloyed",
"url": "https://gitlab.com/Alloyed/love-gltf",
"description": "gltf asset loader and test renderer; Supports skeletal animations and morph targets"
},
{
"name": "Lovox",
"author": "tjakka5",
"url": "https://github.com/tjakka5/Lovox",
"description": "Pseudo-3D library for working with voxels"
},
{
"name": "g3d",
"author": "groverburger",
"url": "https://github.com/groverburger/g3d",
"description": "Simple and easy 3D engine for LÖVE."
},
{
"name": "model_renderer",
"author": "xiejiangzhi",
"url": "https://github.com/xiejiangzhi/model_renderer",
"description": "a simple 3d model renderer for love2d"
},
{
"name": "Jumper",
"author": "Yonaba",
"url": "https://github.com/Yonaba/Jumper",
"description": "Grid-based pathfinding library"
},
{
"name": "Lua-star",
"author": "wesleywerner",
"url": "https://github.com/wesleywerner/lua-star",
"description": "Easy and pure Lua A* path finding"
},
{
"name": "astar",
"author": "xiejiangzhi",
"url": "https://github.com/xiejiangzhi/astar",
"description": "An other A* library. Any map(gird, point, mesh or infinite map) and support path cost."
},
{
"name": "andross",
"author": "pfirsich",
"url": "https://github.com/pfirsich/andross",
"description": "a Lua library for 2D skeletal/bone animations with a Löve backend"
},
{
"name": "anim8",
"author": "kikito",
"url": "https://github.com/kikito/anim8",
"description": "Animation library"
},
{
"name": "animx",
"author": "YoungNeer",
"url": "https://github.com/YoungNeer/animx",
"description": "A featureful Animation library for loading animations from XML files!"
},
{
"name": "chiro",
"author": "bjornbytes",
"url": "https://github.com/bjornbytes/chiro",
"description": "Convenience wrapper around [Spine](http://esotericsoftware.com)"
},
{
"name": "Peachy",
"author": "josh-perry",
"url": "https://github.com/josh-perry/peachy",
"description": "A parser/renderer for Aseprite animations in LÖVE"
},
{
"name": "skeletor",
"author": "pelevesque",
"url": "https://github.com/pelevesque/skeletor",
"description": "2D skeletal animation system"
},
{
"name": "Walt",
"author": "davisdude",
"url": "https://github.com/davisdude/Walt",
"description": "Animation library"
},
{
"name": "Lump",
"author": "sixFingers",
"url": "https://github.com/sixFingers/lump",
"description": "Adobe Flash animation runtime"
},
{
"name": "lovanim",
"author": "patrixr",
"url": "https://github.com/patrixr/love-animation",
"description": "A minimal stateful animation library"
},
{
"name": "SYSL-Text",
"author": "SystemLogoff",
"url": "https://github.com/SystemLogoff/SYSL-Text",
"description": "Text animation and automatic wrapping library based on tags"
},
{
"name": "Brady",
"author": "davisdude",
"url": "https://github.com/davisdude/Brady",
"description": "Camera library with parallax scrolling"
},
{
"name": "Editgrid",
"author": "bakpakin",
"url": "https://github.com/bakpakin/Editgrid",
"description": "Gamera and HUMP compatible scaling grid"
},
{
"name": "gamera",
"author": "kikito",
"url": "https://github.com/kikito/gamera",
"description": "Camera system"
},
{
"name": "hump.camera",
"author": "en",
"url": "https://hump.readthedocs.io/en/latest/camera.html",
"description": "Camera library with window locking and smooth camera movement interpolation"
},
{
"name": "FPSGraph",
"author": "icrawler",
"url": "https://github.com/icrawler/FPSGraph",
"description": "Small FPS graphing utility"
},
{
"name": "debugGraph",
"author": "Mechazawa",
"url": "https://github.com/Mechazawa/Love-Debug-Graph",
"description": "Small OO FPS graphing utillity based on FPSGraph"
},
{
"name": "Kazari",
"author": "Miku AuahDark",
"url": "https://github.com/MikuAuahDark/Kazari",
"description": "Multitouch gesture and input library."
},
{
"name": "Lovebird",
"author": "rxi",
"url": "https://github.com/rxi/lovebird",
"description": "Browser-based debug console"
},
{
"name": "LoveDebug",
"author": "Ranguna",
"url": "https://github.com/Ranguna/LOVEDEBUG",
"description": "Inline console-like debugger utility"
},
{
"name": "lurker",
"author": "rxi",
"url": "https://github.com/rxi/lurker",
"description": "Auto-swaps changed Lua files in a running game"
},
{
"name": "LÖVE API",
"author": "love2d-community",
"url": "https://github.com/love2d-community/love-api",
"description": "The complete API documentation of LÖVE in a Lua table"
},
{
"name": "LÖVE Build",
"author": "nhartland",
"url": "https://github.com/nhartland/love-build",
"description": "GitHub Action for automated cross-platform builds"
},
{
"name": "LÖVE TypeScript Definitions",
"author": "hazzard993",
"url": "https://github.com/hazzard993/love-typescript-definitions",
"description": "Write LÖVE games with TypeScript"
},
{
"name": "lovelier",
"author": "patrixr",
"url": "https://github.com/patrixr/lovelier",
"description": "A Love2D live reloader with Moonscript support"
},
{
"name": "Artal",
"author": "unXedDani",
"url": "https://github.com/unXedDani/Artal",
"description": "A .PSD parsing library for LÖVE"
},
{
"name": "Autobatch",
"author": "rxi",
"url": "https://github.com/rxi/autobatch",
"description": "Small LÖVE module to automate the use of SpriteBatches"
},
{
"name": "center",
"author": "S-Walrus",
"url": "https://github.com/S-Walrus/center",
"description": "A simple module to dynamically align and fit content to screens of any size"
},