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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
|
---@meta
---
---The primary responsibility for the love.graphics module is the drawing of lines, shapes, text, Images and other Drawable objects onto the screen. Its secondary responsibilities include loading external files (including Images and Fonts) into memory, creating specialized objects (such as ParticleSystems or Canvases) and managing screen geometry.
---
---LÖVE's coordinate system is rooted in the upper-left corner of the screen, which is at location (0, 0). The x axis is horizontal: larger values are further to the right. The y axis is vertical: larger values are further towards the bottom.
---
---In many cases, you draw images or shapes in terms of their upper-left corner.
---
---Many of the functions are used to manipulate the graphics coordinate system, which is essentially the way coordinates are mapped to the display. You can change the position, scale, and even rotation in this way.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics)
---
---@class love.graphics
love.graphics = {}
---
---Applies the given Transform object to the current coordinate transformation.
---
---This effectively multiplies the existing coordinate transformation's matrix with the Transform object's internal matrix to produce the new coordinate transformation.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.applyTransform)
---
---@param transform love.Transform # The Transform object to apply to the current graphics coordinate transform.
function love.graphics.applyTransform(transform) end
---
---Draws a filled or unfilled arc at position (x, y). The arc is drawn from angle1 to angle2 in radians. The segments parameter determines how many segments are used to draw the arc. The more segments, the smoother the edge.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.arc)
---
---@overload fun(drawmode: love.DrawMode, arctype: love.ArcType, x: number, y: number, radius: number, angle1: number, angle2: number, segments?: number)
---@param drawmode love.DrawMode # How to draw the arc.
---@param x number # The position of the center along x-axis.
---@param y number # The position of the center along y-axis.
---@param radius number # Radius of the arc.
---@param angle1 number # The angle at which the arc begins.
---@param angle2 number # The angle at which the arc terminates.
---@param segments? number # The number of segments used for drawing the arc.
function love.graphics.arc(drawmode, x, y, radius, angle1, angle2, segments) end
---
---Creates a screenshot once the current frame is done (after love.draw has finished).
---
---Since this function enqueues a screenshot capture rather than executing it immediately, it can be called from an input callback or love.update and it will still capture all of what's drawn to the screen in that frame.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.captureScreenshot)
---
---@overload fun(callback: function)
---@overload fun(channel: love.Channel)
---@param filename string # The filename to save the screenshot to. The encoded image type is determined based on the extension of the filename, and must be one of the ImageFormats.
function love.graphics.captureScreenshot(filename) end
---
---Draws a circle.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.circle)
---
---@overload fun(mode: love.DrawMode, x: number, y: number, radius: number, segments: number)
---@param mode love.DrawMode # How to draw the circle.
---@param x number # The position of the center along x-axis.
---@param y number # The position of the center along y-axis.
---@param radius number # The radius of the circle.
function love.graphics.circle(mode, x, y, radius) end
---
---Clears the screen or active Canvas to the specified color.
---
---This function is called automatically before love.draw in the default love.run function. See the example in love.run for a typical use of this function.
---
---Note that the scissor area bounds the cleared region.
---
---In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.
---
---In versions prior to background color instead.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.clear)
---
---@overload fun(r: number, g: number, b: number, a?: number, clearstencil?: boolean, cleardepth?: boolean)
---@overload fun(color: table, ..., clearstencil?: boolean, cleardepth?: boolean)
---@overload fun(clearcolor: boolean, clearstencil: boolean, cleardepth: boolean)
function love.graphics.clear() end
---
---Discards (trashes) the contents of the screen or active Canvas. This is a performance optimization function with niche use cases.
---
---If the active Canvas has just been changed and the 'replace' BlendMode is about to be used to draw something which covers the entire screen, calling love.graphics.discard rather than calling love.graphics.clear or doing nothing may improve performance on mobile devices.
---
---On some desktop systems this function may do nothing.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.discard)
---
---@overload fun(discardcolors: table, discardstencil?: boolean)
---@param discardcolor? boolean # Whether to discard the texture(s) of the active Canvas(es) (the contents of the screen if no Canvas is active.)
---@param discardstencil? boolean # Whether to discard the contents of the stencil buffer of the screen / active Canvas.
function love.graphics.discard(discardcolor, discardstencil) end
---
---Draws a Drawable object (an Image, Canvas, SpriteBatch, ParticleSystem, Mesh, Text object, or Video) on the screen with optional rotation, scaling and shearing.
---
---Objects are drawn relative to their local coordinate system. The origin is by default located at the top left corner of Image and Canvas. All scaling, shearing, and rotation arguments transform the object relative to that point. Also, the position of the origin can be specified on the screen coordinate system.
---
---It's possible to rotate an object about its center by offsetting the origin to the center. Angles must be given in radians for rotation. One can also use a negative scaling factor to flip about its centerline.
---
---Note that the offsets are applied before rotation, scaling, or shearing; scaling and shearing are applied before rotation.
---
---The right and bottom edges of the object are shifted at an angle defined by the shearing factors.
---
---When using the default shader anything drawn with this function will be tinted according to the currently selected color.
---
---Set it to pure white to preserve the object's original colors.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.draw)
---
---@overload fun(texture: love.Texture, quad: love.Quad, x: number, y: number, r?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number)
---@overload fun(drawable: love.Drawable, transform: love.Transform)
---@overload fun(texture: love.Texture, quad: love.Quad, transform: love.Transform)
---@param drawable love.Drawable # A drawable object.
---@param x? number # The position to draw the object (x-axis).
---@param y? number # The position to draw the object (y-axis).
---@param r? number # Orientation (radians).
---@param sx? number # Scale factor (x-axis).
---@param sy? number # Scale factor (y-axis).
---@param ox? number # Origin offset (x-axis).
---@param oy? number # Origin offset (y-axis).
---@param kx? number # Shearing factor (x-axis).
---@param ky? number # Shearing factor (y-axis).
function love.graphics.draw(drawable, x, y, r, sx, sy, ox, oy, kx, ky) end
---
---Draws many instances of a Mesh with a single draw call, using hardware geometry instancing.
---
---Each instance can have unique properties (positions, colors, etc.) but will not by default unless a custom per-instance vertex attributes or the love_InstanceID GLSL 3 vertex shader variable is used, otherwise they will all render at the same position on top of each other.
---
---Instancing is not supported by some older GPUs that are only capable of using OpenGL ES 2 or OpenGL 2. Use love.graphics.getSupported to check.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.drawInstanced)
---
---@overload fun(mesh: love.Mesh, instancecount: number, transform: love.Transform)
---@param mesh love.Mesh # The mesh to render.
---@param instancecount number # The number of instances to render.
---@param x? number # The position to draw the instances (x-axis).
---@param y? number # The position to draw the instances (y-axis).
---@param r? number # Orientation (radians).
---@param sx? number # Scale factor (x-axis).
---@param sy? number # Scale factor (y-axis).
---@param ox? number # Origin offset (x-axis).
---@param oy? number # Origin offset (y-axis).
---@param kx? number # Shearing factor (x-axis).
---@param ky? number # Shearing factor (y-axis).
function love.graphics.drawInstanced(mesh, instancecount, x, y, r, sx, sy, ox, oy, kx, ky) end
---
---Draws a layer of an Array Texture.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.drawLayer)
---
---@overload fun(texture: love.Texture, layerindex: number, quad: love.Quad, x?: number, y?: number, r?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number)
---@overload fun(texture: love.Texture, layerindex: number, transform: love.Transform)
---@overload fun(texture: love.Texture, layerindex: number, quad: love.Quad, transform: love.Transform)
---@param texture love.Texture # The Array Texture to draw.
---@param layerindex number # The index of the layer to use when drawing.
---@param x? number # The position to draw the texture (x-axis).
---@param y? number # The position to draw the texture (y-axis).
---@param r? number # Orientation (radians).
---@param sx? number # Scale factor (x-axis).
---@param sy? number # Scale factor (y-axis).
---@param ox? number # Origin offset (x-axis).
---@param oy? number # Origin offset (y-axis).
---@param kx? number # Shearing factor (x-axis).
---@param ky? number # Shearing factor (y-axis).
function love.graphics.drawLayer(texture, layerindex, x, y, r, sx, sy, ox, oy, kx, ky) end
---
---Draws an ellipse.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.ellipse)
---
---@overload fun(mode: love.DrawMode, x: number, y: number, radiusx: number, radiusy: number, segments: number)
---@param mode love.DrawMode # How to draw the ellipse.
---@param x number # The position of the center along x-axis.
---@param y number # The position of the center along y-axis.
---@param radiusx number # The radius of the ellipse along the x-axis (half the ellipse's width).
---@param radiusy number # The radius of the ellipse along the y-axis (half the ellipse's height).
function love.graphics.ellipse(mode, x, y, radiusx, radiusy) end
---
---Immediately renders any pending automatically batched draws.
---
---LÖVE will call this function internally as needed when most state is changed, so it is not necessary to manually call it.
---
---The current batch will be automatically flushed by love.graphics state changes (except for the transform stack and the current color), as well as Shader:send and methods on Textures which change their state. Using a different Image in consecutive love.graphics.draw calls will also flush the current batch.
---
---SpriteBatches, ParticleSystems, Meshes, and Text objects do their own batching and do not affect automatic batching of other draws, aside from flushing the current batch when they're drawn.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.flushBatch)
---
function love.graphics.flushBatch() end
---
---Gets the current background color.
---
---In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getBackgroundColor)
---
---@return number r # The red component (0-1).
---@return number g # The green component (0-1).
---@return number b # The blue component (0-1).
---@return number a # The alpha component (0-1).
function love.graphics.getBackgroundColor() end
---
---Gets the blending mode.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getBlendMode)
---
---@return love.BlendMode mode # The current blend mode.
---@return love.BlendAlphaMode alphamode # The current blend alpha mode – it determines how the alpha of drawn objects affects blending.
function love.graphics.getBlendMode() end
---
---Gets the current target Canvas.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getCanvas)
---
---@return love.Canvas canvas # The Canvas set by setCanvas. Returns nil if drawing to the real screen.
function love.graphics.getCanvas() end
---
---Gets the available Canvas formats, and whether each is supported.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getCanvasFormats)
---
---@overload fun(readable: boolean):table
---@return table formats # A table containing CanvasFormats as keys, and a boolean indicating whether the format is supported as values. Not all systems support all formats.
function love.graphics.getCanvasFormats() end
---
---Gets the current color.
---
---In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getColor)
---
---@return number r # The red component (0-1).
---@return number g # The green component (0-1).
---@return number b # The blue component (0-1).
---@return number a # The alpha component (0-1).
function love.graphics.getColor() end
---
---Gets the active color components used when drawing. Normally all 4 components are active unless love.graphics.setColorMask has been used.
---
---The color mask determines whether individual components of the colors of drawn objects will affect the color of the screen. They affect love.graphics.clear and Canvas:clear as well.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getColorMask)
---
---@return boolean r # Whether the red color component is active when rendering.
---@return boolean g # Whether the green color component is active when rendering.
---@return boolean b # Whether the blue color component is active when rendering.
---@return boolean a # Whether the alpha color component is active when rendering.
function love.graphics.getColorMask() end
---
---Gets the DPI scale factor of the window.
---
---The DPI scale factor represents relative pixel density. The pixel density inside the window might be greater (or smaller) than the 'size' of the window. For example on a retina screen in Mac OS X with the highdpi window flag enabled, the window may take up the same physical size as an 800x600 window, but the area inside the window uses 1600x1200 pixels. love.graphics.getDPIScale() would return 2 in that case.
---
---The love.window.fromPixels and love.window.toPixels functions can also be used to convert between units.
---
---The highdpi window flag must be enabled to use the full pixel density of a Retina screen on Mac OS X and iOS. The flag currently does nothing on Windows and Linux, and on Android it is effectively always enabled.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getDPIScale)
---
---@return number scale # The pixel scale factor associated with the window.
function love.graphics.getDPIScale() end
---
---Returns the default scaling filters used with Images, Canvases, and Fonts.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getDefaultFilter)
---
---@return love.FilterMode min # Filter mode used when scaling the image down.
---@return love.FilterMode mag # Filter mode used when scaling the image up.
---@return number anisotropy # Maximum amount of Anisotropic Filtering used.
function love.graphics.getDefaultFilter() end
---
---Gets the current depth test mode and whether writing to the depth buffer is enabled.
---
---This is low-level functionality designed for use with custom vertex shaders and Meshes with custom vertex attributes. No higher level APIs are provided to set the depth of 2D graphics such as shapes, lines, and Images.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getDepthMode)
---
---@return love.CompareMode comparemode # Depth comparison mode used for depth testing.
---@return boolean write # Whether to write update / write values to the depth buffer when rendering.
function love.graphics.getDepthMode() end
---
---Gets the width and height in pixels of the window.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getDimensions)
---
---@return number width # The width of the window.
---@return number height # The height of the window.
function love.graphics.getDimensions() end
---
---Gets the current Font object.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getFont)
---
---@return love.Font font # The current Font. Automatically creates and sets the default font, if none is set yet.
function love.graphics.getFont() end
---
---Gets whether triangles with clockwise- or counterclockwise-ordered vertices are considered front-facing.
---
---This is designed for use in combination with Mesh face culling. Other love.graphics shapes, lines, and sprites are not guaranteed to have a specific winding order to their internal vertices.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getFrontFaceWinding)
---
---@return love.VertexWinding winding # The winding mode being used. The default winding is counterclockwise ('ccw').
function love.graphics.getFrontFaceWinding() end
---
---Gets the height in pixels of the window.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getHeight)
---
---@return number height # The height of the window.
function love.graphics.getHeight() end
---
---Gets the raw and compressed pixel formats usable for Images, and whether each is supported.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getImageFormats)
---
---@return table formats # A table containing PixelFormats as keys, and a boolean indicating whether the format is supported as values. Not all systems support all formats.
function love.graphics.getImageFormats() end
---
---Gets the line join style.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getLineJoin)
---
---@return love.LineJoin join # The LineJoin style.
function love.graphics.getLineJoin() end
---
---Gets the line style.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getLineStyle)
---
---@return love.LineStyle style # The current line style.
function love.graphics.getLineStyle() end
---
---Gets the current line width.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getLineWidth)
---
---@return number width # The current line width.
function love.graphics.getLineWidth() end
---
---Gets whether back-facing triangles in a Mesh are culled.
---
---Mesh face culling is designed for use with low level custom hardware-accelerated 3D rendering via custom vertex attributes on Meshes, custom vertex shaders, and depth testing with a depth buffer.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getMeshCullMode)
---
---@return love.CullMode mode # The Mesh face culling mode in use (whether to render everything, cull back-facing triangles, or cull front-facing triangles).
function love.graphics.getMeshCullMode() end
---
---Gets the width and height in pixels of the window.
---
---love.graphics.getDimensions gets the dimensions of the window in units scaled by the screen's DPI scale factor, rather than pixels. Use getDimensions for calculations related to drawing to the screen and using the graphics coordinate system (calculating the center of the screen, for example), and getPixelDimensions only when dealing specifically with underlying pixels (pixel-related calculations in a pixel Shader, for example).
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getPixelDimenions)
---
---@return number pixelwidth # The width of the window in pixels.
---@return number pixelheight # The height of the window in pixels.
function love.graphics.getPixelDimenions() end
---
---Gets the height in pixels of the window.
---
---The graphics coordinate system and DPI scale factor, rather than raw pixels. Use getHeight for calculations related to drawing to the screen and using the coordinate system (calculating the center of the screen, for example), and getPixelHeight only when dealing specifically with underlying pixels (pixel-related calculations in a pixel Shader, for example).
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getPixelHeight)
---
---@return number pixelheight # The height of the window in pixels.
function love.graphics.getPixelHeight() end
---
---Gets the width in pixels of the window.
---
---The graphics coordinate system and DPI scale factor, rather than raw pixels. Use getWidth for calculations related to drawing to the screen and using the coordinate system (calculating the center of the screen, for example), and getPixelWidth only when dealing specifically with underlying pixels (pixel-related calculations in a pixel Shader, for example).
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getPixelWidth)
---
---@return number pixelwidth # The width of the window in pixels.
function love.graphics.getPixelWidth() end
---
---Gets the point size.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getPointSize)
---
---@return number size # The current point size.
function love.graphics.getPointSize() end
---
---Gets information about the system's video card and drivers.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getRendererInfo)
---
---@return string name # The name of the renderer, e.g. 'OpenGL' or 'OpenGL ES'.
---@return string version # The version of the renderer with some extra driver-dependent version info, e.g. '2.1 INTEL-8.10.44'.
---@return string vendor # The name of the graphics card vendor, e.g. 'Intel Inc'.
---@return string device # The name of the graphics card, e.g. 'Intel HD Graphics 3000 OpenGL Engine'.
function love.graphics.getRendererInfo() end
---
---Gets the current scissor box.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getScissor)
---
---@return number x # The x-component of the top-left point of the box.
---@return number y # The y-component of the top-left point of the box.
---@return number width # The width of the box.
---@return number height # The height of the box.
function love.graphics.getScissor() end
---
---Gets the current Shader. Returns nil if none is set.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getShader)
---
---@return love.Shader shader # The currently active Shader, or nil if none is set.
function love.graphics.getShader() end
---
---Gets the current depth of the transform / state stack (the number of pushes without corresponding pops).
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getStackDepth)
---
---@return number depth # The current depth of the transform and state love.graphics stack.
function love.graphics.getStackDepth() end
---
---Gets performance-related rendering statistics.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getStats)
---
---@overload fun(stats: table):table
---@return {drawcalls: number, canvasswitches: number, texturememory: number, images: number, canvases: number, fonts: number, shaderswitches: number, drawcallsbatched: number} stats # A table with the following fields:
function love.graphics.getStats() end
---
---Gets the current stencil test configuration.
---
---When stencil testing is enabled, the geometry of everything that is drawn afterward will be clipped / stencilled out based on a comparison between the arguments of this function and the stencil value of each pixel that the geometry touches. The stencil values of pixels are affected via love.graphics.stencil.
---
---Each Canvas has its own per-pixel stencil values.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getStencilTest)
---
---@return love.CompareMode comparemode # The type of comparison that is made for each pixel. Will be 'always' if stencil testing is disabled.
---@return number comparevalue # The value used when comparing with the stencil value of each pixel.
function love.graphics.getStencilTest() end
---
---Gets the optional graphics features and whether they're supported on the system.
---
---Some older or low-end systems don't always support all graphics features.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getSupported)
---
---@return table features # A table containing GraphicsFeature keys, and boolean values indicating whether each feature is supported.
function love.graphics.getSupported() end
---
---Gets the system-dependent maximum values for love.graphics features.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getSystemLimits)
---
---@return table limits # A table containing GraphicsLimit keys, and number values.
function love.graphics.getSystemLimits() end
---
---Gets the available texture types, and whether each is supported.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getTextureTypes)
---
---@return table texturetypes # A table containing TextureTypes as keys, and a boolean indicating whether the type is supported as values. Not all systems support all types.
function love.graphics.getTextureTypes() end
---
---Gets the width in pixels of the window.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.getWidth)
---
---@return number width # The width of the window.
function love.graphics.getWidth() end
---
---Sets the scissor to the rectangle created by the intersection of the specified rectangle with the existing scissor.
---
---If no scissor is active yet, it behaves like love.graphics.setScissor.
---
---The scissor limits the drawing area to a specified rectangle. This affects all graphics calls, including love.graphics.clear.
---
---The dimensions of the scissor is unaffected by graphical transformations (translate, scale, ...).
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.intersectScissor)
---
---@param x number # The x-coordinate of the upper left corner of the rectangle to intersect with the existing scissor rectangle.
---@param y number # The y-coordinate of the upper left corner of the rectangle to intersect with the existing scissor rectangle.
---@param width number # The width of the rectangle to intersect with the existing scissor rectangle.
---@param height number # The height of the rectangle to intersect with the existing scissor rectangle.
function love.graphics.intersectScissor(x, y, width, height) end
---
---Converts the given 2D position from screen-space into global coordinates.
---
---This effectively applies the reverse of the current graphics transformations to the given position. A similar Transform:inverseTransformPoint method exists for Transform objects.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.inverseTransformPoint)
---
---@param screenX number # The x component of the screen-space position.
---@param screenY number # The y component of the screen-space position.
---@return number globalX # The x component of the position in global coordinates.
---@return number globalY # The y component of the position in global coordinates.
function love.graphics.inverseTransformPoint(screenX, screenY) end
---
---Gets whether the graphics module is able to be used. If it is not active, love.graphics function and method calls will not work correctly and may cause the program to crash.
---The graphics module is inactive if a window is not open, or if the app is in the background on iOS. Typically the app's execution will be automatically paused by the system, in the latter case.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.isActive)
---
---@return boolean active # Whether the graphics module is active and able to be used.
function love.graphics.isActive() end
---
---Gets whether gamma-correct rendering is supported and enabled. It can be enabled by setting t.gammacorrect = true in love.conf.
---
---Not all devices support gamma-correct rendering, in which case it will be automatically disabled and this function will return false. It is supported on desktop systems which have graphics cards that are capable of using OpenGL 3 / DirectX 10, and iOS devices that can use OpenGL ES 3.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.isGammaCorrect)
---
---@return boolean gammacorrect # True if gamma-correct rendering is supported and was enabled in love.conf, false otherwise.
function love.graphics.isGammaCorrect() end
---
---Gets whether wireframe mode is used when drawing.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.isWireframe)
---
---@return boolean wireframe # True if wireframe lines are used when drawing, false if it's not.
function love.graphics.isWireframe() end
---
---Draws lines between points.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.line)
---
---@overload fun(points: table)
---@param x1 number # The position of first point on the x-axis.
---@param y1 number # The position of first point on the y-axis.
---@param x2 number # The position of second point on the x-axis.
---@param y2 number # The position of second point on the y-axis.
---@vararg number # You can continue passing point positions to draw a polyline.
function love.graphics.line(x1, y1, x2, y2, ...) end
---
---Creates a new array Image.
---
---An array image / array texture is a single object which contains multiple 'layers' or 'slices' of 2D sub-images. It can be thought of similarly to a texture atlas or sprite sheet, but it doesn't suffer from the same tile / quad bleeding artifacts that texture atlases do – although every sub-image must have the same dimensions.
---
---A specific layer of an array image can be drawn with love.graphics.drawLayer / SpriteBatch:addLayer, or with the Quad variant of love.graphics.draw and Quad:setLayer, or via a custom Shader.
---
---To use an array image in a Shader, it must be declared as a ArrayImage or sampler2DArray type (instead of Image or sampler2D). The Texel(ArrayImage image, vec3 texturecoord) shader function must be used to get pixel colors from a slice of the array image. The vec3 argument contains the texture coordinate in the first two components, and the 0-based slice index in the third component.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.newArrayImage)
---
---@param slices table # A table containing filepaths to images (or File, FileData, ImageData, or CompressedImageData objects), in an array. Each sub-image must have the same dimensions. A table of tables can also be given, where each sub-table contains all mipmap levels for the slice index of that sub-table.
---@param settings? {mipmaps: boolean, linear: boolean, dpiscale: number} # Optional table of settings to configure the array image, containing the following fields:
---@return love.Image image # An Array Image object.
function love.graphics.newArrayImage(slices, settings) end
---
---Creates a new Canvas object for offscreen rendering.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.newCanvas)
---
---@overload fun(width: number, height: number):love.Canvas
---@overload fun(width: number, height: number, settings: table):love.Canvas
---@overload fun(width: number, height: number, layers: number, settings: table):love.Canvas
---@return love.Canvas canvas # A new Canvas with dimensions equal to the window's size in pixels.
function love.graphics.newCanvas() end
---
---Creates a new cubemap Image.
---
---Cubemap images have 6 faces (sides) which represent a cube. They can't be rendered directly, they can only be used in Shader code (and sent to the shader via Shader:send).
---
---To use a cubemap image in a Shader, it must be declared as a CubeImage or samplerCube type (instead of Image or sampler2D). The Texel(CubeImage image, vec3 direction) shader function must be used to get pixel colors from the cubemap. The vec3 argument is a normalized direction from the center of the cube, rather than explicit texture coordinates.
---
---Each face in a cubemap image must have square dimensions.
---
---For variants of this function which accept a single image containing multiple cubemap faces, they must be laid out in one of the following forms in the image:
---
--- +y
---
---+z +x -z
---
--- -y
---
--- -x
---
---or:
---
--- +y
---
----x +z +x -z
---
--- -y
---
---or:
---
---+x
---
----x
---
---+y
---
----y
---
---+z
---
----z
---
---or:
---
---+x -x +y -y +z -z
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.newCubeImage)
---
---@overload fun(faces: table, settings?: table):love.Image
---@param filename string # The filepath to a cubemap image file (or a File, FileData, or ImageData).
---@param settings? {mipmaps: boolean, linear: boolean} # Optional table of settings to configure the cubemap image, containing the following fields:
---@return love.Image image # An cubemap Image object.
function love.graphics.newCubeImage(filename, settings) end
---
---Creates a new Font from a TrueType Font or BMFont file. Created fonts are not cached, in that calling this function with the same arguments will always create a new Font object.
---
---All variants which accept a filename can also accept a Data object instead.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.newFont)
---
---@overload fun(filename: string, size: number, hinting?: love.HintingMode, dpiscale?: number):love.Font
---@overload fun(filename: string, imagefilename: string):love.Font
---@overload fun(size?: number, hinting?: love.HintingMode, dpiscale?: number):love.Font
---@param filename string # The filepath to the BMFont or TrueType font file.
---@return love.Font font # A Font object which can be used to draw text on screen.
function love.graphics.newFont(filename) end
---
---Creates a new Image from a filepath, FileData, an ImageData, or a CompressedImageData, and optionally generates or specifies mipmaps for the image.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.newImage)
---
---@overload fun(fileData: love.FileData, settings?: table):love.Image
---@overload fun(imageData: love.ImageData, settings?: table):love.Image
---@overload fun(compressedImageData: love.CompressedImageData, settings?: table):love.Image
---@param filename string # The filepath to the image file.
---@param settings? {dpiscale: number, linear: boolean, mipmaps: boolean} # A table containing the following fields:
---@return love.Image image # A new Image object which can be drawn on screen.
function love.graphics.newImage(filename, settings) end
---
---Creates a new specifically formatted image.
---
---In versions prior to 0.9.0, LÖVE expects ISO 8859-1 encoding for the glyphs string.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.newImageFont)
---
---@overload fun(imageData: love.ImageData, glyphs: string):love.Font
---@overload fun(filename: string, glyphs: string, extraspacing: number):love.Font
---@param filename string # The filepath to the image file.
---@param glyphs string # A string of the characters in the image in order from left to right.
---@return love.Font font # A Font object which can be used to draw text on screen.
function love.graphics.newImageFont(filename, glyphs) end
---
---Creates a new Mesh.
---
---Use Mesh:setTexture if the Mesh should be textured with an Image or Canvas when it's drawn.
---
---In versions prior to 11.0, color and byte component values were within the range of 0 to 255 instead of 0 to 1.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.newMesh)
---
---@overload fun(vertexcount: number, mode?: love.MeshDrawMode, usage?: love.SpriteBatchUsage):love.Mesh
---@overload fun(vertexformat: table, vertices: table, mode?: love.MeshDrawMode, usage?: love.SpriteBatchUsage):love.Mesh
---@overload fun(vertexformat: table, vertexcount: number, mode?: love.MeshDrawMode, usage?: love.SpriteBatchUsage):love.Mesh
---@overload fun(vertexcount: number, texture?: love.Texture, mode?: love.MeshDrawMode):love.Mesh
---@param vertices {["1"]: number, ["2"]: number, ["3"]: number, ["4"]: number, ["5"]: number, ["6"]: number, ["7"]: number, ["8"]: number} # The table filled with vertex information tables for each vertex as follows:
---@param mode? love.MeshDrawMode # How the vertices are used when drawing. The default mode 'fan' is sufficient for simple convex polygons.
---@param usage? love.SpriteBatchUsage # The expected usage of the Mesh. The specified usage mode affects the Mesh's memory usage and performance.
---@return love.Mesh mesh # The new mesh.
function love.graphics.newMesh(vertices, mode, usage) end
---
---Creates a new ParticleSystem.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.newParticleSystem)
---
---@overload fun(texture: love.Texture, buffer?: number):love.ParticleSystem
---@param image love.Image # The image to use.
---@param buffer? number # The max number of particles at the same time.
---@return love.ParticleSystem system # A new ParticleSystem.
function love.graphics.newParticleSystem(image, buffer) end
---
---Creates a new Quad.
---
---The purpose of a Quad is to use a fraction of an image to draw objects, as opposed to drawing entire image. It is most useful for sprite sheets and atlases: in a sprite atlas, multiple sprites reside in same image, quad is used to draw a specific sprite from that image; in animated sprites with all frames residing in the same image, quad is used to draw specific frame from the animation.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.newQuad)
---
---@param x number # The top-left position in the Image along the x-axis.
---@param y number # The top-left position in the Image along the y-axis.
---@param width number # The width of the Quad in the Image. (Must be greater than 0.)
---@param height number # The height of the Quad in the Image. (Must be greater than 0.)
---@param sw number # The reference width, the width of the Image. (Must be greater than 0.)
---@param sh number # The reference height, the height of the Image. (Must be greater than 0.)
---@return love.Quad quad # The new Quad.
function love.graphics.newQuad(x, y, width, height, sw, sh) end
---
---Creates a new Shader object for hardware-accelerated vertex and pixel effects. A Shader contains either vertex shader code, pixel shader code, or both.
---
---Shaders are small programs which are run on the graphics card when drawing. Vertex shaders are run once for each vertex (for example, an image has 4 vertices - one at each corner. A Mesh might have many more.) Pixel shaders are run once for each pixel on the screen which the drawn object touches. Pixel shader code is executed after all the object's vertices have been processed by the vertex shader.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.newShader)
---
---@overload fun(pixelcode: string, vertexcode: string):love.Shader
---@param code string # The pixel shader or vertex shader code, or a filename pointing to a file with the code.
---@return love.Shader shader # A Shader object for use in drawing operations.
function love.graphics.newShader(code) end
---
---Creates a new SpriteBatch object.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.newSpriteBatch)
---
---@overload fun(image: love.Image, maxsprites?: number, usage?: love.SpriteBatchUsage):love.SpriteBatch
---@overload fun(texture: love.Texture, maxsprites?: number, usage?: love.SpriteBatchUsage):love.SpriteBatch
---@param image love.Image # The Image to use for the sprites.
---@param maxsprites? number # The maximum number of sprites that the SpriteBatch can contain at any given time. Since version 11.0, additional sprites added past this number will automatically grow the spritebatch.
---@return love.SpriteBatch spriteBatch # The new SpriteBatch.
function love.graphics.newSpriteBatch(image, maxsprites) end
---
---Creates a new drawable Text object.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.newText)
---
---@param font love.Font # The font to use for the text.
---@param textstring? string # The initial string of text that the new Text object will contain. May be nil.
---@return love.Text text # The new drawable Text object.
function love.graphics.newText(font, textstring) end
---
---Creates a new drawable Video. Currently only Ogg Theora video files are supported.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.newVideo)
---
---@overload fun(videostream: love.VideoStream):love.Video
---@overload fun(filename: string, settings?: table):love.Video
---@overload fun(filename: string, loadaudio?: boolean):love.Video
---@overload fun(videostream: love.VideoStream, loadaudio?: boolean):love.Video
---@param filename string # The file path to the Ogg Theora video file.
---@return love.Video video # A new Video.
function love.graphics.newVideo(filename) end
---
---Creates a new volume (3D) Image.
---
---Volume images are 3D textures with width, height, and depth. They can't be rendered directly, they can only be used in Shader code (and sent to the shader via Shader:send).
---
---To use a volume image in a Shader, it must be declared as a VolumeImage or sampler3D type (instead of Image or sampler2D). The Texel(VolumeImage image, vec3 texcoords) shader function must be used to get pixel colors from the volume image. The vec3 argument is a normalized texture coordinate with the z component representing the depth to sample at (ranging from 1).
---
---Volume images are typically used as lookup tables in shaders for color grading, for example, because sampling using a texture coordinate that is partway in between two pixels can interpolate across all 3 dimensions in the volume image, resulting in a smooth gradient even when a small-sized volume image is used as the lookup table.
---
---Array images are a much better choice than volume images for storing multiple different sprites in a single array image for directly drawing them.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.newVolumeImage)
---
---@param layers table # A table containing filepaths to images (or File, FileData, ImageData, or CompressedImageData objects), in an array. A table of tables can also be given, where each sub-table represents a single mipmap level and contains all layers for that mipmap.
---@param settings? {mipmaps: boolean, linear: boolean} # Optional table of settings to configure the volume image, containing the following fields:
---@return love.Image image # A volume Image object.
function love.graphics.newVolumeImage(layers, settings) end
---
---Resets the current coordinate transformation.
---
---This function is always used to reverse any previous calls to love.graphics.rotate, love.graphics.scale, love.graphics.shear or love.graphics.translate. It returns the current transformation state to its defaults.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.origin)
---
function love.graphics.origin() end
---
---Draws one or more points.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.points)
---
---@overload fun(points: table)
---@overload fun(points: table)
---@param x number # The position of the first point on the x-axis.
---@param y number # The position of the first point on the y-axis.
---@vararg number # The x and y coordinates of additional points.
function love.graphics.points(x, y, ...) end
---
---Draw a polygon.
---
---Following the mode argument, this function can accept multiple numeric arguments or a single table of numeric arguments. In either case the arguments are interpreted as alternating x and y coordinates of the polygon's vertices.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.polygon)
---
---@overload fun(mode: love.DrawMode, vertices: table)
---@param mode love.DrawMode # How to draw the polygon.
---@vararg number # The vertices of the polygon.
function love.graphics.polygon(mode, ...) end
---
---Pops the current coordinate transformation from the transformation stack.
---
---This function is always used to reverse a previous push operation. It returns the current transformation state to what it was before the last preceding push.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.pop)
---
function love.graphics.pop() end
---
---Displays the results of drawing operations on the screen.
---
---This function is used when writing your own love.run function. It presents all the results of your drawing operations on the screen. See the example in love.run for a typical use of this function.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.present)
---
function love.graphics.present() end
---
---Draws text on screen. If no Font is set, one will be created and set (once) if needed.
---
---As of LOVE 0.7.1, when using translation and scaling functions while drawing text, this function assumes the scale occurs first.
---
---If you don't script with this in mind, the text won't be in the right position, or possibly even on screen.
---
---love.graphics.print and love.graphics.printf both support UTF-8 encoding. You'll also need a proper Font for special characters.
---
---In versions prior to 11.0, color and byte component values were within the range of 0 to 255 instead of 0 to 1.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.print)
---
---@overload fun(coloredtext: table, x?: number, y?: number, angle?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number)
---@overload fun(text: string, transform: love.Transform)
---@overload fun(coloredtext: table, transform: love.Transform)
---@overload fun(text: string, font: love.Font, transform: love.Transform)
---@overload fun(coloredtext: table, font: love.Font, transform: love.Transform)
---@param text string # The text to draw.
---@param x? number # The position to draw the object (x-axis).
---@param y? number # The position to draw the object (y-axis).
---@param r? number # Orientation (radians).
---@param sx? number # Scale factor (x-axis).
---@param sy? number # Scale factor (y-axis).
---@param ox? number # Origin offset (x-axis).
---@param oy? number # Origin offset (y-axis).
---@param kx? number # Shearing factor (x-axis).
---@param ky? number # Shearing factor (y-axis).
function love.graphics.print(text, x, y, r, sx, sy, ox, oy, kx, ky) end
---
---Draws formatted text, with word wrap and alignment.
---
---See additional notes in love.graphics.print.
---
---The word wrap limit is applied before any scaling, rotation, and other coordinate transformations. Therefore the amount of text per line stays constant given the same wrap limit, even if the scale arguments change.
---
---In version 0.9.2 and earlier, wrapping was implemented by breaking up words by spaces and putting them back together to make sure things fit nicely within the limit provided. However, due to the way this is done, extra spaces between words would end up missing when printed on the screen, and some lines could overflow past the provided wrap limit. In version 0.10.0 and newer this is no longer the case.
---
---In versions prior to 11.0, color and byte component values were within the range of 0 to 255 instead of 0 to 1.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.printf)
---
---@overload fun(text: string, font: love.Font, x: number, y: number, limit: number, align?: love.AlignMode, r?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number)
---@overload fun(text: string, transform: love.Transform, limit: number, align?: love.AlignMode)
---@overload fun(text: string, font: love.Font, transform: love.Transform, limit: number, align?: love.AlignMode)
---@overload fun(coloredtext: table, x: number, y: number, limit: number, align: love.AlignMode, angle?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number)
---@overload fun(coloredtext: table, font: love.Font, x: number, y: number, limit: number, align?: love.AlignMode, angle?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number)
---@overload fun(coloredtext: table, transform: love.Transform, limit: number, align?: love.AlignMode)
---@overload fun(coloredtext: table, font: love.Font, transform: love.Transform, limit: number, align?: love.AlignMode)
---@param text string # A text string.
---@param x number # The position on the x-axis.
---@param y number # The position on the y-axis.
---@param limit number # Wrap the line after this many horizontal pixels.
---@param align? love.AlignMode # The alignment.
---@param r? number # Orientation (radians).
---@param sx? number # Scale factor (x-axis).
---@param sy? number # Scale factor (y-axis).
---@param ox? number # Origin offset (x-axis).
---@param oy? number # Origin offset (y-axis).
---@param kx? number # Shearing factor (x-axis).
---@param ky? number # Shearing factor (y-axis).
function love.graphics.printf(text, x, y, limit, align, r, sx, sy, ox, oy, kx, ky) end
---
---Copies and pushes the current coordinate transformation to the transformation stack.
---
---This function is always used to prepare for a corresponding pop operation later. It stores the current coordinate transformation state into the transformation stack and keeps it active. Later changes to the transformation can be undone by using the pop operation, which returns the coordinate transform to the state it was in before calling push.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.push)
---
---@overload fun(stack: love.StackType)
function love.graphics.push() end
---
---Draws a rectangle.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.rectangle)
---
---@overload fun(mode: love.DrawMode, x: number, y: number, width: number, height: number, rx: number, ry?: number, segments?: number)
---@param mode love.DrawMode # How to draw the rectangle.
---@param x number # The position of top-left corner along the x-axis.
---@param y number # The position of top-left corner along the y-axis.
---@param width number # Width of the rectangle.
---@param height number # Height of the rectangle.
function love.graphics.rectangle(mode, x, y, width, height) end
---
---Replaces the current coordinate transformation with the given Transform object.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.replaceTransform)
---
---@param transform love.Transform # The Transform object to replace the current graphics coordinate transform with.
function love.graphics.replaceTransform(transform) end
---
---Resets the current graphics settings.
---
---Calling reset makes the current drawing color white, the current background color black, disables any active color component masks, disables wireframe mode and resets the current graphics transformation to the origin. It also sets both the point and line drawing modes to smooth and their sizes to 1.0.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.reset)
---
function love.graphics.reset() end
---
---Rotates the coordinate system in two dimensions.
---
---Calling this function affects all future drawing operations by rotating the coordinate system around the origin by the given amount of radians. This change lasts until love.draw() exits.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.rotate)
---
---@param angle number # The amount to rotate the coordinate system in radians.
function love.graphics.rotate(angle) end
---
---Scales the coordinate system in two dimensions.
---
---By default the coordinate system in LÖVE corresponds to the display pixels in horizontal and vertical directions one-to-one, and the x-axis increases towards the right while the y-axis increases downwards. Scaling the coordinate system changes this relation.
---
---After scaling by sx and sy, all coordinates are treated as if they were multiplied by sx and sy. Every result of a drawing operation is also correspondingly scaled, so scaling by (2, 2) for example would mean making everything twice as large in both x- and y-directions. Scaling by a negative value flips the coordinate system in the corresponding direction, which also means everything will be drawn flipped or upside down, or both. Scaling by zero is not a useful operation.
---
---Scale and translate are not commutative operations, therefore, calling them in different orders will change the outcome.
---
---Scaling lasts until love.draw() exits.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.scale)
---
---@param sx number # The scaling in the direction of the x-axis.
---@param sy? number # The scaling in the direction of the y-axis. If omitted, it defaults to same as parameter sx.
function love.graphics.scale(sx, sy) end
---
---Sets the background color.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.setBackgroundColor)
---
---@overload fun(rgba: table)
---@param red number # The red component (0-1).
---@param green number # The green component (0-1).
---@param blue number # The blue component (0-1).
---@param alpha? number # The alpha component (0-1).
function love.graphics.setBackgroundColor(red, green, blue, alpha) end
---
---Sets the blending mode.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.setBlendMode)
---
---@overload fun(mode: love.BlendMode, alphamode?: love.BlendAlphaMode)
---@param mode love.BlendMode # The blend mode to use.
function love.graphics.setBlendMode(mode) end
---
---Captures drawing operations to a Canvas.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.setCanvas)
---
---@overload fun()
---@overload fun(canvas1: love.Canvas, canvas2: love.Canvas, ...)
---@overload fun(canvas: love.Canvas, slice: number, mipmap?: number)
---@overload fun(setup: table)
---@param canvas love.Canvas # The new target.
---@param mipmap? number # The mipmap level to render to, for Canvases with mipmaps.
function love.graphics.setCanvas(canvas, mipmap) end
---
---Sets the color used for drawing.
---
---In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.setColor)
---
---@overload fun(rgba: table)
---@param red number # The amount of red.
---@param green number # The amount of green.
---@param blue number # The amount of blue.
---@param alpha? number # The amount of alpha. The alpha value will be applied to all subsequent draw operations, even the drawing of an image.
function love.graphics.setColor(red, green, blue, alpha) end
---
---Sets the color mask. Enables or disables specific color components when rendering and clearing the screen. For example, if '''red''' is set to '''false''', no further changes will be made to the red component of any pixels.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.setColorMask)
---
---@overload fun()
---@param red boolean # Render red component.
---@param green boolean # Render green component.
---@param blue boolean # Render blue component.
---@param alpha boolean # Render alpha component.
function love.graphics.setColorMask(red, green, blue, alpha) end
---
---Sets the default scaling filters used with Images, Canvases, and Fonts.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.setDefaultFilter)
---
---@param min love.FilterMode # Filter mode used when scaling the image down.
---@param mag love.FilterMode # Filter mode used when scaling the image up.
---@param anisotropy? number # Maximum amount of Anisotropic Filtering used.
function love.graphics.setDefaultFilter(min, mag, anisotropy) end
---
---Configures depth testing and writing to the depth buffer.
---
---This is low-level functionality designed for use with custom vertex shaders and Meshes with custom vertex attributes. No higher level APIs are provided to set the depth of 2D graphics such as shapes, lines, and Images.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.setDepthMode)
---
---@overload fun()
---@param comparemode love.CompareMode # Depth comparison mode used for depth testing.
---@param write boolean # Whether to write update / write values to the depth buffer when rendering.
function love.graphics.setDepthMode(comparemode, write) end
---
---Set an already-loaded Font as the current font or create and load a new one from the file and size.
---
---It's recommended that Font objects are created with love.graphics.newFont in the loading stage and then passed to this function in the drawing stage.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.setFont)
---
---@param font love.Font # The Font object to use.
function love.graphics.setFont(font) end
---
---Sets whether triangles with clockwise- or counterclockwise-ordered vertices are considered front-facing.
---
---This is designed for use in combination with Mesh face culling. Other love.graphics shapes, lines, and sprites are not guaranteed to have a specific winding order to their internal vertices.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.setFrontFaceWinding)
---
---@param winding love.VertexWinding # The winding mode to use. The default winding is counterclockwise ('ccw').
function love.graphics.setFrontFaceWinding(winding) end
---
---Sets the line join style. See LineJoin for the possible options.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.setLineJoin)
---
---@param join love.LineJoin # The LineJoin to use.
function love.graphics.setLineJoin(join) end
---
---Sets the line style.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.setLineStyle)
---
---@param style love.LineStyle # The LineStyle to use. Line styles include smooth and rough.
function love.graphics.setLineStyle(style) end
---
---Sets the line width.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.setLineWidth)
---
---@param width number # The width of the line.
function love.graphics.setLineWidth(width) end
---
---Sets whether back-facing triangles in a Mesh are culled.
---
---This is designed for use with low level custom hardware-accelerated 3D rendering via custom vertex attributes on Meshes, custom vertex shaders, and depth testing with a depth buffer.
---
---By default, both front- and back-facing triangles in Meshes are rendered.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.setMeshCullMode)
---
---@param mode love.CullMode # The Mesh face culling mode to use (whether to render everything, cull back-facing triangles, or cull front-facing triangles).
function love.graphics.setMeshCullMode(mode) end
---
---Creates and sets a new Font.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.setNewFont)
---
---@overload fun(filename: string, size?: number):love.Font
---@overload fun(file: love.File, size?: number):love.Font
---@overload fun(data: love.Data, size?: number):love.Font
---@overload fun(rasterizer: love.Rasterizer):love.Font
---@param size? number # The size of the font.
---@return love.Font font # The new font.
function love.graphics.setNewFont(size) end
---
---Sets the point size.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.setPointSize)
---
---@param size number # The new point size.
function love.graphics.setPointSize(size) end
---
---Sets or disables scissor.
---
---The scissor limits the drawing area to a specified rectangle. This affects all graphics calls, including love.graphics.clear.
---
---The dimensions of the scissor is unaffected by graphical transformations (translate, scale, ...).
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.setScissor)
---
---@overload fun()
---@param x number # x coordinate of upper left corner.
---@param y number # y coordinate of upper left corner.
---@param width number # width of clipping rectangle.
---@param height number # height of clipping rectangle.
function love.graphics.setScissor(x, y, width, height) end
---
---Sets or resets a Shader as the current pixel effect or vertex shaders. All drawing operations until the next ''love.graphics.setShader'' will be drawn using the Shader object specified.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.setShader)
---
---@overload fun()
---@param shader love.Shader # The new shader.
function love.graphics.setShader(shader) end
---
---Configures or disables stencil testing.
---
---When stencil testing is enabled, the geometry of everything that is drawn afterward will be clipped / stencilled out based on a comparison between the arguments of this function and the stencil value of each pixel that the geometry touches. The stencil values of pixels are affected via love.graphics.stencil.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.setStencilTest)
---
---@overload fun()
---@param comparemode love.CompareMode # The type of comparison to make for each pixel.
---@param comparevalue number # The value to use when comparing with the stencil value of each pixel. Must be between 0 and 255.
function love.graphics.setStencilTest(comparemode, comparevalue) end
---
---Sets whether wireframe lines will be used when drawing.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.setWireframe)
---
---@param enable boolean # True to enable wireframe mode when drawing, false to disable it.
function love.graphics.setWireframe(enable) end
---
---Shears the coordinate system.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.shear)
---
---@param kx number # The shear factor on the x-axis.
---@param ky number # The shear factor on the y-axis.
function love.graphics.shear(kx, ky) end
---
---Draws geometry as a stencil.
---
---The geometry drawn by the supplied function sets invisible stencil values of pixels, instead of setting pixel colors. The stencil buffer (which contains those stencil values) can act like a mask / stencil - love.graphics.setStencilTest can be used afterward to determine how further rendering is affected by the stencil values in each pixel.
---
---Stencil values are integers within the range of 255.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.stencil)
---
---@param stencilfunction function # Function which draws geometry. The stencil values of pixels, rather than the color of each pixel, will be affected by the geometry.
---@param action? love.StencilAction # How to modify any stencil values of pixels that are touched by what's drawn in the stencil function.
---@param value? number # The new stencil value to use for pixels if the 'replace' stencil action is used. Has no effect with other stencil actions. Must be between 0 and 255.
---@param keepvalues? boolean # True to preserve old stencil values of pixels, false to re-set every pixel's stencil value to 0 before executing the stencil function. love.graphics.clear will also re-set all stencil values.
function love.graphics.stencil(stencilfunction, action, value, keepvalues) end
---
---Converts the given 2D position from global coordinates into screen-space.
---
---This effectively applies the current graphics transformations to the given position. A similar Transform:transformPoint method exists for Transform objects.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.transformPoint)
---
---@param globalX number # The x component of the position in global coordinates.
---@param globalY number # The y component of the position in global coordinates.
---@return number screenX # The x component of the position with graphics transformations applied.
---@return number screenY # The y component of the position with graphics transformations applied.
function love.graphics.transformPoint(globalX, globalY) end
---
---Translates the coordinate system in two dimensions.
---
---When this function is called with two numbers, dx, and dy, all the following drawing operations take effect as if their x and y coordinates were x+dx and y+dy.
---
---Scale and translate are not commutative operations, therefore, calling them in different orders will change the outcome.
---
---This change lasts until love.draw() exits or else a love.graphics.pop reverts to a previous love.graphics.push.
---
---Translating using whole numbers will prevent tearing/blurring of images and fonts draw after translating.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.translate)
---
---@param dx number # The translation relative to the x-axis.
---@param dy number # The translation relative to the y-axis.
function love.graphics.translate(dx, dy) end
---
---Validates shader code. Check if specified shader code does not contain any errors.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics.validateShader)
---
---@overload fun(gles: boolean, pixelcode: string, vertexcode: string):boolean, string
---@param gles boolean # Validate code as GLSL ES shader.
---@param code string # The pixel shader or vertex shader code, or a filename pointing to a file with the code.
---@return boolean status # true if specified shader code doesn't contain any errors. false otherwise.
---@return string message # Reason why shader code validation failed (or nil if validation succeded).
function love.graphics.validateShader(gles, code) end
---
---A Canvas is used for off-screen rendering. Think of it as an invisible screen that you can draw to, but that will not be visible until you draw it to the actual visible screen. It is also known as "render to texture".
---
---By drawing things that do not change position often (such as background items) to the Canvas, and then drawing the entire Canvas instead of each item, you can reduce the number of draw operations performed each frame.
---
---In versions prior to love.graphics.isSupported("canvas") could be used to check for support at runtime.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics)
---
---@class love.Canvas: love.Texture, love.Drawable, love.Object
local Canvas = {}
---
---Generates mipmaps for the Canvas, based on the contents of the highest-resolution mipmap level.
---
---The Canvas must be created with mipmaps set to a MipmapMode other than 'none' for this function to work. It should only be called while the Canvas is not the active render target.
---
---If the mipmap mode is set to 'auto', this function is automatically called inside love.graphics.setCanvas when switching from this Canvas to another Canvas or to the main screen.
---
---
---[Open in Browser](https://love2d.org/wiki/Canvas:generateMipmaps)
---
function Canvas:generateMipmaps() end
---
---Gets the number of multisample antialiasing (MSAA) samples used when drawing to the Canvas.
---
---This may be different than the number used as an argument to love.graphics.newCanvas if the system running LÖVE doesn't support that number.
---
---
---[Open in Browser](https://love2d.org/wiki/Canvas:getMSAA)
---
---@return number samples # The number of multisample antialiasing samples used by the canvas when drawing to it.
function Canvas:getMSAA() end
---
---Gets the MipmapMode this Canvas was created with.
---
---
---[Open in Browser](https://love2d.org/wiki/Canvas:getMipmapMode)
---
---@return love.MipmapMode mode # The mipmap mode this Canvas was created with.
function Canvas:getMipmapMode() end
---
---Generates ImageData from the contents of the Canvas.
---
---
---[Open in Browser](https://love2d.org/wiki/Canvas:newImageData)
---
---@overload fun(self: love.Canvas, slice: number, mipmap?: number, x: number, y: number, width: number, height: number):love.ImageData
---@return love.ImageData data # The new ImageData made from the Canvas' contents.
function Canvas:newImageData() end
---
---Render to the Canvas using a function.
---
---This is a shortcut to love.graphics.setCanvas:
---
---canvas:renderTo( func )
---
---is the same as
---
---love.graphics.setCanvas( canvas )
---
---func()
---
---love.graphics.setCanvas()
---
---
---[Open in Browser](https://love2d.org/wiki/Canvas:renderTo)
---
---@param func function # A function performing drawing operations.
function Canvas:renderTo(func) end
---
---Superclass for all things that can be drawn on screen. This is an abstract type that can't be created directly.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics)
---
---@class love.Drawable: love.Object
local Drawable = {}
---
---Defines the shape of characters that can be drawn onto the screen.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics)
---
---@class love.Font: love.Object
local Font = {}
---
---Gets the ascent of the Font.
---
---The ascent spans the distance between the baseline and the top of the glyph that reaches farthest from the baseline.
---
---
---[Open in Browser](https://love2d.org/wiki/Font:getAscent)
---
---@return number ascent # The ascent of the Font in pixels.
function Font:getAscent() end
---
---Gets the baseline of the Font.
---
---Most scripts share the notion of a baseline: an imaginary horizontal line on which characters rest. In some scripts, parts of glyphs lie below the baseline.
---
---
---[Open in Browser](https://love2d.org/wiki/Font:getBaseline)
---
---@return number baseline # The baseline of the Font in pixels.
function Font:getBaseline() end
---
---Gets the DPI scale factor of the Font.
---
---The DPI scale factor represents relative pixel density. A DPI scale factor of 2 means the font's glyphs have twice the pixel density in each dimension (4 times as many pixels in the same area) compared to a font with a DPI scale factor of 1.
---
---The font size of TrueType fonts is scaled internally by the font's specified DPI scale factor. By default, LÖVE uses the screen's DPI scale factor when creating TrueType fonts.
---
---
---[Open in Browser](https://love2d.org/wiki/Font:getDPIScale)
---
---@return number dpiscale # The DPI scale factor of the Font.
function Font:getDPIScale() end
---
---Gets the descent of the Font.
---
---The descent spans the distance between the baseline and the lowest descending glyph in a typeface.
---
---
---[Open in Browser](https://love2d.org/wiki/Font:getDescent)
---
---@return number descent # The descent of the Font in pixels.
function Font:getDescent() end
---
---Gets the filter mode for a font.
---
---
---[Open in Browser](https://love2d.org/wiki/Font:getFilter)
---
---@return love.FilterMode min # Filter mode used when minifying the font.
---@return love.FilterMode mag # Filter mode used when magnifying the font.
---@return number anisotropy # Maximum amount of anisotropic filtering used.
function Font:getFilter() end
---
---Gets the height of the Font.
---
---The height of the font is the size including any spacing; the height which it will need.
---
---
---[Open in Browser](https://love2d.org/wiki/Font:getHeight)
---
---@return number height # The height of the Font in pixels.
function Font:getHeight() end
---
---Gets the kerning between two characters in the Font.
---
---Kerning is normally handled automatically in love.graphics.print, Text objects, Font:getWidth, Font:getWrap, etc. This function is useful when stitching text together manually.
---
---
---[Open in Browser](https://love2d.org/wiki/Font:getKerning)
---
---@overload fun(self: love.Font, leftglyph: number, rightglyph: number):number
---@param leftchar string # The left character.
---@param rightchar string # The right character.
---@return number kerning # The kerning amount to add to the spacing between the two characters. May be negative.
function Font:getKerning(leftchar, rightchar) end
---
---Gets the line height.
---
---This will be the value previously set by Font:setLineHeight, or 1.0 by default.
---
---
---[Open in Browser](https://love2d.org/wiki/Font:getLineHeight)
---
---@return number height # The current line height.
function Font:getLineHeight() end
---
---Determines the maximum width (accounting for newlines) taken by the given string.
---
---
---[Open in Browser](https://love2d.org/wiki/Font:getWidth)
---
---@param text string # A string.
---@return number width # The width of the text.
function Font:getWidth(text) end
---
---Gets formatting information for text, given a wrap limit.
---
---This function accounts for newlines correctly (i.e. '\n').
---
---
---[Open in Browser](https://love2d.org/wiki/Font:getWrap)
---
---@param text string # The text that will be wrapped.
---@param wraplimit number # The maximum width in pixels of each line that ''text'' is allowed before wrapping.
---@return number width # The maximum width of the wrapped text.
---@return table wrappedtext # A sequence containing each line of text that was wrapped.
function Font:getWrap(text, wraplimit) end
---
---Gets whether the Font can render a character or string.
---
---
---[Open in Browser](https://love2d.org/wiki/Font:hasGlyphs)
---
---@overload fun(self: love.Font, character1: string, character2: string):boolean
---@overload fun(self: love.Font, codepoint1: number, codepoint2: number):boolean
---@param text string # A UTF-8 encoded unicode string.
---@return boolean hasglyph # Whether the font can render all the UTF-8 characters in the string.
function Font:hasGlyphs(text) end
---
---Sets the fallback fonts. When the Font doesn't contain a glyph, it will substitute the glyph from the next subsequent fallback Fonts. This is akin to setting a 'font stack' in Cascading Style Sheets (CSS).
---
---
---[Open in Browser](https://love2d.org/wiki/Font:setFallbacks)
---
---@param fallbackfont1 love.Font # The first fallback Font to use.
---@vararg love.Font # Additional fallback Fonts.
function Font:setFallbacks(fallbackfont1, ...) end
---
---Sets the filter mode for a font.
---
---
---[Open in Browser](https://love2d.org/wiki/Font:setFilter)
---
---@param min love.FilterMode # How to scale a font down.
---@param mag love.FilterMode # How to scale a font up.
---@param anisotropy? number # Maximum amount of anisotropic filtering used.
function Font:setFilter(min, mag, anisotropy) end
---
---Sets the line height.
---
---When rendering the font in lines the actual height will be determined by the line height multiplied by the height of the font. The default is 1.0.
---
---
---[Open in Browser](https://love2d.org/wiki/Font:setLineHeight)
---
---@param height number # The new line height.
function Font:setLineHeight(height) end
---
---Drawable image type.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics)
---
---@class love.Image: love.Texture, love.Drawable, love.Object
local Image = {}
---
---Gets the flags used when the image was created.
---
---
---[Open in Browser](https://love2d.org/wiki/Image:getFlags)
---
---@return table flags # A table with ImageFlag keys.
function Image:getFlags() end
---
---Gets whether the Image was created from CompressedData.
---
---Compressed images take up less space in VRAM, and drawing a compressed image will generally be more efficient than drawing one created from raw pixel data.
---
---
---[Open in Browser](https://love2d.org/wiki/Image:isCompressed)
---
---@return boolean compressed # Whether the Image is stored as a compressed texture on the GPU.
function Image:isCompressed() end
---
---Replace the contents of an Image.
---
---
---[Open in Browser](https://love2d.org/wiki/Image:replacePixels)
---
---@param data love.ImageData # The new ImageData to replace the contents with.
---@param slice number # Which cubemap face, array index, or volume layer to replace, if applicable.
---@param mipmap? number # The mimap level to replace, if the Image has mipmaps.
---@param x? number # The x-offset in pixels from the top-left of the image to replace. The given ImageData's width plus this value must not be greater than the pixel width of the Image's specified mipmap level.
---@param y? number # The y-offset in pixels from the top-left of the image to replace. The given ImageData's height plus this value must not be greater than the pixel height of the Image's specified mipmap level.
---@param reloadmipmaps boolean # Whether to generate new mipmaps after replacing the Image's pixels. True by default if the Image was created with automatically generated mipmaps, false by default otherwise.
function Image:replacePixels(data, slice, mipmap, x, y, reloadmipmaps) end
---
---A 2D polygon mesh used for drawing arbitrary textured shapes.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics)
---
---@class love.Mesh: love.Drawable, love.Object
local Mesh = {}
---
---Attaches a vertex attribute from a different Mesh onto this Mesh, for use when drawing. This can be used to share vertex attribute data between several different Meshes.
---
---
---[Open in Browser](https://love2d.org/wiki/Mesh:attachAttribute)
---
---@overload fun(self: love.Mesh, name: string, mesh: love.Mesh, step?: love.VertexAttributeStep, attachname?: string)
---@param name string # The name of the vertex attribute to attach.
---@param mesh love.Mesh # The Mesh to get the vertex attribute from.
function Mesh:attachAttribute(name, mesh) end
---
---Removes a previously attached vertex attribute from this Mesh.
---
---
---[Open in Browser](https://love2d.org/wiki/Mesh:detachAttribute)
---
---@param name string # The name of the attached vertex attribute to detach.
---@return boolean success # Whether the attribute was successfully detached.
function Mesh:detachAttribute(name) end
---
---Gets the mode used when drawing the Mesh.
---
---
---[Open in Browser](https://love2d.org/wiki/Mesh:getDrawMode)
---
---@return love.MeshDrawMode mode # The mode used when drawing the Mesh.
function Mesh:getDrawMode() end
---
---Gets the range of vertices used when drawing the Mesh.
---
---
---[Open in Browser](https://love2d.org/wiki/Mesh:getDrawRange)
---
---@return number min # The index of the first vertex used when drawing, or the index of the first value in the vertex map used if one is set for this Mesh.
---@return number max # The index of the last vertex used when drawing, or the index of the last value in the vertex map used if one is set for this Mesh.
function Mesh:getDrawRange() end
---
---Gets the texture (Image or Canvas) used when drawing the Mesh.
---
---
---[Open in Browser](https://love2d.org/wiki/Mesh:getTexture)
---
---@return love.Texture texture # The Image or Canvas to texture the Mesh with when drawing, or nil if none is set.
function Mesh:getTexture() end
---
---Gets the properties of a vertex in the Mesh.
---
---In versions prior to 11.0, color and byte component values were within the range of 0 to 255 instead of 0 to 1.
---
---
---[Open in Browser](https://love2d.org/wiki/Mesh:getVertex)
---
---@overload fun(self: love.Mesh, index: number):number, number, number, number, number, number, number, number
---@param index number # The one-based index of the vertex you want to retrieve the information for.
---@return number attributecomponent # The first component of the first vertex attribute in the specified vertex.
function Mesh:getVertex(index) end
---
---Gets the properties of a specific attribute within a vertex in the Mesh.
---
---Meshes without a custom vertex format specified in love.graphics.newMesh have position as their first attribute, texture coordinates as their second attribute, and color as their third attribute.
---
---
---[Open in Browser](https://love2d.org/wiki/Mesh:getVertexAttribute)
---
---@param vertexindex number # The index of the the vertex you want to retrieve the attribute for (one-based).
---@param attributeindex number # The index of the attribute within the vertex to be retrieved (one-based).
---@return number value1 # The value of the first component of the attribute.
---@return number value2 # The value of the second component of the attribute.
function Mesh:getVertexAttribute(vertexindex, attributeindex) end
---
---Gets the total number of vertices in the Mesh.
---
---
---[Open in Browser](https://love2d.org/wiki/Mesh:getVertexCount)
---
---@return number count # The total number of vertices in the mesh.
function Mesh:getVertexCount() end
---
---Gets the vertex format that the Mesh was created with.
---
---
---[Open in Browser](https://love2d.org/wiki/Mesh:getVertexFormat)
---
---@return {attribute: table} format # The vertex format of the Mesh, which is a table containing tables for each vertex attribute the Mesh was created with, in the form of {attribute, ...}.
function Mesh:getVertexFormat() end
---
---Gets the vertex map for the Mesh. The vertex map describes the order in which the vertices are used when the Mesh is drawn. The vertices, vertex map, and mesh draw mode work together to determine what exactly is displayed on the screen.
---
---If no vertex map has been set previously via Mesh:setVertexMap, then this function will return nil in LÖVE 0.10.0+, or an empty table in 0.9.2 and older.
---
---
---[Open in Browser](https://love2d.org/wiki/Mesh:getVertexMap)
---
---@return table map # A table containing the list of vertex indices used when drawing.
function Mesh:getVertexMap() end
---
---Gets whether a specific vertex attribute in the Mesh is enabled. Vertex data from disabled attributes is not used when drawing the Mesh.
---
---
---[Open in Browser](https://love2d.org/wiki/Mesh:isAttributeEnabled)
---
---@param name string # The name of the vertex attribute to be checked.
---@return boolean enabled # Whether the vertex attribute is used when drawing this Mesh.
function Mesh:isAttributeEnabled(name) end
---
---Enables or disables a specific vertex attribute in the Mesh. Vertex data from disabled attributes is not used when drawing the Mesh.
---
---
---[Open in Browser](https://love2d.org/wiki/Mesh:setAttributeEnabled)
---
---@param name string # The name of the vertex attribute to enable or disable.
---@param enable boolean # Whether the vertex attribute is used when drawing this Mesh.
function Mesh:setAttributeEnabled(name, enable) end
---
---Sets the mode used when drawing the Mesh.
---
---
---[Open in Browser](https://love2d.org/wiki/Mesh:setDrawMode)
---
---@param mode love.MeshDrawMode # The mode to use when drawing the Mesh.
function Mesh:setDrawMode(mode) end
---
---Restricts the drawn vertices of the Mesh to a subset of the total.
---
---
---[Open in Browser](https://love2d.org/wiki/Mesh:setDrawRange)
---
---@overload fun(self: love.Mesh)
---@param start number # The index of the first vertex to use when drawing, or the index of the first value in the vertex map to use if one is set for this Mesh.
---@param count number # The number of vertices to use when drawing, or number of values in the vertex map to use if one is set for this Mesh.
function Mesh:setDrawRange(start, count) end
---
---Sets the texture (Image or Canvas) used when drawing the Mesh.
---
---
---[Open in Browser](https://love2d.org/wiki/Mesh:setTexture)
---
---@overload fun(self: love.Mesh)
---@param texture love.Texture # The Image or Canvas to texture the Mesh with when drawing.
function Mesh:setTexture(texture) end
---
---Sets the properties of a vertex in the Mesh.
---
---In versions prior to 11.0, color and byte component values were within the range of 0 to 255 instead of 0 to 1.
---
---
---[Open in Browser](https://love2d.org/wiki/Mesh:setVertex)
---
---@overload fun(self: love.Mesh, index: number, vertex: table)
---@overload fun(self: love.Mesh, index: number, x: number, y: number, u: number, v: number, r?: number, g?: number, b?: number, a?: number)
---@overload fun(self: love.Mesh, index: number, vertex: table)
---@param index number # The index of the the vertex you want to modify (one-based).
---@param attributecomponent number # The first component of the first vertex attribute in the specified vertex.
---@vararg number # Additional components of all vertex attributes in the specified vertex.
function Mesh:setVertex(index, attributecomponent, ...) end
---
---Sets the properties of a specific attribute within a vertex in the Mesh.
---
---Meshes without a custom vertex format specified in love.graphics.newMesh have position as their first attribute, texture coordinates as their second attribute, and color as their third attribute.
---
---
---[Open in Browser](https://love2d.org/wiki/Mesh:setVertexAttribute)
---
---@param vertexindex number # The index of the the vertex to be modified (one-based).
---@param attributeindex number # The index of the attribute within the vertex to be modified (one-based).
---@param value1 number # The new value for the first component of the attribute.
---@param value2 number # The new value for the second component of the attribute.
---@vararg number # Any additional vertex attribute components.
function Mesh:setVertexAttribute(vertexindex, attributeindex, value1, value2, ...) end
---
---Sets the vertex map for the Mesh. The vertex map describes the order in which the vertices are used when the Mesh is drawn. The vertices, vertex map, and mesh draw mode work together to determine what exactly is displayed on the screen.
---
---The vertex map allows you to re-order or reuse vertices when drawing without changing the actual vertex parameters or duplicating vertices. It is especially useful when combined with different Mesh Draw Modes.
---
---
---[Open in Browser](https://love2d.org/wiki/Mesh:setVertexMap)
---
---@overload fun(self: love.Mesh, vi1: number, vi2: number, vi3: number)
---@overload fun(self: love.Mesh, data: love.Data, datatype: love.IndexDataType)
---@param map table # A table containing a list of vertex indices to use when drawing. Values must be in the range of Mesh:getVertexCount().
function Mesh:setVertexMap(map) end
---
---Replaces a range of vertices in the Mesh with new ones. The total number of vertices in a Mesh cannot be changed after it has been created. This is often more efficient than calling Mesh:setVertex in a loop.
---
---
---[Open in Browser](https://love2d.org/wiki/Mesh:setVertices)
---
---@overload fun(self: love.Mesh, data: love.Data, startvertex?: number)
---@overload fun(self: love.Mesh, vertices: table)
---@param vertices {attributecomponent: number} # The table filled with vertex information tables for each vertex, in the form of {vertex, ...} where each vertex is a table in the form of {attributecomponent, ...}.
---@param startvertex? number # The index of the first vertex to replace.
function Mesh:setVertices(vertices, startvertex) end
---
---A ParticleSystem can be used to create particle effects like fire or smoke.
---
---The particle system has to be created using update it in the update callback to see any changes in the particles emitted.
---
---The particle system won't create any particles unless you call setParticleLifetime and setEmissionRate.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics)
---
---@class love.ParticleSystem: love.Drawable, love.Object
local ParticleSystem = {}
---
---Creates an identical copy of the ParticleSystem in the stopped state.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:clone)
---
---@return love.ParticleSystem particlesystem # The new identical copy of this ParticleSystem.
function ParticleSystem:clone() end
---
---Emits a burst of particles from the particle emitter.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:emit)
---
---@param numparticles number # The amount of particles to emit. The number of emitted particles will be truncated if the particle system's max buffer size is reached.
function ParticleSystem:emit(numparticles) end
---
---Gets the maximum number of particles the ParticleSystem can have at once.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:getBufferSize)
---
---@return number size # The maximum number of particles.
function ParticleSystem:getBufferSize() end
---
---Gets the series of colors applied to the particle sprite.
---
---In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:getColors)
---
---@return number r1 # First color, red component (0-1).
---@return number g1 # First color, green component (0-1).
---@return number b1 # First color, blue component (0-1).
---@return number a1 # First color, alpha component (0-1).
---@return number r2 # Second color, red component (0-1).
---@return number g2 # Second color, green component (0-1).
---@return number b2 # Second color, blue component (0-1).
---@return number a2 # Second color, alpha component (0-1).
---@return number r8 # Eighth color, red component (0-1).
---@return number g8 # Eighth color, green component (0-1).
---@return number b8 # Eighth color, blue component (0-1).
---@return number a8 # Eighth color, alpha component (0-1).
function ParticleSystem:getColors() end
---
---Gets the number of particles that are currently in the system.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:getCount)
---
---@return number count # The current number of live particles.
function ParticleSystem:getCount() end
---
---Gets the direction of the particle emitter (in radians).
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:getDirection)
---
---@return number direction # The direction of the emitter (radians).
function ParticleSystem:getDirection() end
---
---Gets the area-based spawn parameters for the particles.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:getEmissionArea)
---
---@return love.AreaSpreadDistribution distribution # The type of distribution for new particles.
---@return number dx # The maximum spawn distance from the emitter along the x-axis for uniform distribution, or the standard deviation along the x-axis for normal distribution.
---@return number dy # The maximum spawn distance from the emitter along the y-axis for uniform distribution, or the standard deviation along the y-axis for normal distribution.
---@return number angle # The angle in radians of the emission area.
---@return boolean directionRelativeToCenter # True if newly spawned particles will be oriented relative to the center of the emission area, false otherwise.
function ParticleSystem:getEmissionArea() end
---
---Gets the amount of particles emitted per second.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:getEmissionRate)
---
---@return number rate # The amount of particles per second.
function ParticleSystem:getEmissionRate() end
---
---Gets how long the particle system will emit particles (if -1 then it emits particles forever).
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:getEmitterLifetime)
---
---@return number life # The lifetime of the emitter (in seconds).
function ParticleSystem:getEmitterLifetime() end
---
---Gets the mode used when the ParticleSystem adds new particles.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:getInsertMode)
---
---@return love.ParticleInsertMode mode # The mode used when the ParticleSystem adds new particles.
function ParticleSystem:getInsertMode() end
---
---Gets the linear acceleration (acceleration along the x and y axes) for particles.
---
---Every particle created will accelerate along the x and y axes between xmin,ymin and xmax,ymax.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:getLinearAcceleration)
---
---@return number xmin # The minimum acceleration along the x axis.
---@return number ymin # The minimum acceleration along the y axis.
---@return number xmax # The maximum acceleration along the x axis.
---@return number ymax # The maximum acceleration along the y axis.
function ParticleSystem:getLinearAcceleration() end
---
---Gets the amount of linear damping (constant deceleration) for particles.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:getLinearDamping)
---
---@return number min # The minimum amount of linear damping applied to particles.
---@return number max # The maximum amount of linear damping applied to particles.
function ParticleSystem:getLinearDamping() end
---
---Gets the particle image's draw offset.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:getOffset)
---
---@return number ox # The x coordinate of the particle image's draw offset.
---@return number oy # The y coordinate of the particle image's draw offset.
function ParticleSystem:getOffset() end
---
---Gets the lifetime of the particles.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:getParticleLifetime)
---
---@return number min # The minimum life of the particles (in seconds).
---@return number max # The maximum life of the particles (in seconds).
function ParticleSystem:getParticleLifetime() end
---
---Gets the position of the emitter.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:getPosition)
---
---@return number x # Position along x-axis.
---@return number y # Position along y-axis.
function ParticleSystem:getPosition() end
---
---Gets the series of Quads used for the particle sprites.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:getQuads)
---
---@return table quads # A table containing the Quads used.
function ParticleSystem:getQuads() end
---
---Gets the radial acceleration (away from the emitter).
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:getRadialAcceleration)
---
---@return number min # The minimum acceleration.
---@return number max # The maximum acceleration.
function ParticleSystem:getRadialAcceleration() end
---
---Gets the rotation of the image upon particle creation (in radians).
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:getRotation)
---
---@return number min # The minimum initial angle (radians).
---@return number max # The maximum initial angle (radians).
function ParticleSystem:getRotation() end
---
---Gets the amount of size variation (0 meaning no variation and 1 meaning full variation between start and end).
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:getSizeVariation)
---
---@return number variation # The amount of variation (0 meaning no variation and 1 meaning full variation between start and end).
function ParticleSystem:getSizeVariation() end
---
---Gets the series of sizes by which the sprite is scaled. 1.0 is normal size. The particle system will interpolate between each size evenly over the particle's lifetime.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:getSizes)
---
---@return number size1 # The first size.
---@return number size2 # The second size.
---@return number size8 # The eighth size.
function ParticleSystem:getSizes() end
---
---Gets the speed of the particles.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:getSpeed)
---
---@return number min # The minimum linear speed of the particles.
---@return number max # The maximum linear speed of the particles.
function ParticleSystem:getSpeed() end
---
---Gets the spin of the sprite.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:getSpin)
---
---@return number min # The minimum spin (radians per second).
---@return number max # The maximum spin (radians per second).
---@return number variation # The degree of variation (0 meaning no variation and 1 meaning full variation between start and end).
function ParticleSystem:getSpin() end
---
---Gets the amount of spin variation (0 meaning no variation and 1 meaning full variation between start and end).
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:getSpinVariation)
---
---@return number variation # The amount of variation (0 meaning no variation and 1 meaning full variation between start and end).
function ParticleSystem:getSpinVariation() end
---
---Gets the amount of directional spread of the particle emitter (in radians).
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:getSpread)
---
---@return number spread # The spread of the emitter (radians).
function ParticleSystem:getSpread() end
---
---Gets the tangential acceleration (acceleration perpendicular to the particle's direction).
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:getTangentialAcceleration)
---
---@return number min # The minimum acceleration.
---@return number max # The maximum acceleration.
function ParticleSystem:getTangentialAcceleration() end
---
---Gets the texture (Image or Canvas) used for the particles.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:getTexture)
---
---@return love.Texture texture # The Image or Canvas used for the particles.
function ParticleSystem:getTexture() end
---
---Gets whether particle angles and rotations are relative to their velocities. If enabled, particles are aligned to the angle of their velocities and rotate relative to that angle.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:hasRelativeRotation)
---
---@return boolean enable # True if relative particle rotation is enabled, false if it's disabled.
function ParticleSystem:hasRelativeRotation() end
---
---Checks whether the particle system is actively emitting particles.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:isActive)
---
---@return boolean active # True if system is active, false otherwise.
function ParticleSystem:isActive() end
---
---Checks whether the particle system is paused.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:isPaused)
---
---@return boolean paused # True if system is paused, false otherwise.
function ParticleSystem:isPaused() end
---
---Checks whether the particle system is stopped.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:isStopped)
---
---@return boolean stopped # True if system is stopped, false otherwise.
function ParticleSystem:isStopped() end
---
---Moves the position of the emitter. This results in smoother particle spawning behaviour than if ParticleSystem:setPosition is used every frame.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:moveTo)
---
---@param x number # Position along x-axis.
---@param y number # Position along y-axis.
function ParticleSystem:moveTo(x, y) end
---
---Pauses the particle emitter.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:pause)
---
function ParticleSystem:pause() end
---
---Resets the particle emitter, removing any existing particles and resetting the lifetime counter.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:reset)
---
function ParticleSystem:reset() end
---
---Sets the size of the buffer (the max allowed amount of particles in the system).
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:setBufferSize)
---
---@param size number # The buffer size.
function ParticleSystem:setBufferSize(size) end
---
---Sets a series of colors to apply to the particle sprite. The particle system will interpolate between each color evenly over the particle's lifetime.
---
---Arguments can be passed in groups of four, representing the components of the desired RGBA value, or as tables of RGBA component values, with a default alpha value of 1 if only three values are given. At least one color must be specified. A maximum of eight may be used.
---
---In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:setColors)
---
---@overload fun(self: love.ParticleSystem, rgba1: table, rgba2: table, rgba8: table)
---@param r1 number # First color, red component (0-1).
---@param g1 number # First color, green component (0-1).
---@param b1 number # First color, blue component (0-1).
---@param a1? number # First color, alpha component (0-1).
---@param r2? number # Second color, red component (0-1).
---@param g2? number # Second color, green component (0-1).
---@param b2? number # Second color, blue component (0-1).
---@param a2? number # Second color, alpha component (0-1).
---@param r8? number # Eighth color, red component (0-1).
---@param g8? number # Eighth color, green component (0-1).
---@param b8? number # Eighth color, blue component (0-1).
---@param a8? number # Eighth color, alpha component (0-1).
function ParticleSystem:setColors(r1, g1, b1, a1, r2, g2, b2, a2, r8, g8, b8, a8) end
---
---Sets the direction the particles will be emitted in.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:setDirection)
---
---@param direction number # The direction of the particles (in radians).
function ParticleSystem:setDirection(direction) end
---
---Sets area-based spawn parameters for the particles. Newly created particles will spawn in an area around the emitter based on the parameters to this function.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:setEmissionArea)
---
---@param distribution love.AreaSpreadDistribution # The type of distribution for new particles.
---@param dx number # The maximum spawn distance from the emitter along the x-axis for uniform distribution, or the standard deviation along the x-axis for normal distribution.
---@param dy number # The maximum spawn distance from the emitter along the y-axis for uniform distribution, or the standard deviation along the y-axis for normal distribution.
---@param angle? number # The angle in radians of the emission area.
---@param directionRelativeToCenter? boolean # True if newly spawned particles will be oriented relative to the center of the emission area, false otherwise.
function ParticleSystem:setEmissionArea(distribution, dx, dy, angle, directionRelativeToCenter) end
---
---Sets the amount of particles emitted per second.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:setEmissionRate)
---
---@param rate number # The amount of particles per second.
function ParticleSystem:setEmissionRate(rate) end
---
---Sets how long the particle system should emit particles (if -1 then it emits particles forever).
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:setEmitterLifetime)
---
---@param life number # The lifetime of the emitter (in seconds).
function ParticleSystem:setEmitterLifetime(life) end
---
---Sets the mode to use when the ParticleSystem adds new particles.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:setInsertMode)
---
---@param mode love.ParticleInsertMode # The mode to use when the ParticleSystem adds new particles.
function ParticleSystem:setInsertMode(mode) end
---
---Sets the linear acceleration (acceleration along the x and y axes) for particles.
---
---Every particle created will accelerate along the x and y axes between xmin,ymin and xmax,ymax.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:setLinearAcceleration)
---
---@param xmin number # The minimum acceleration along the x axis.
---@param ymin number # The minimum acceleration along the y axis.
---@param xmax? number # The maximum acceleration along the x axis.
---@param ymax? number # The maximum acceleration along the y axis.
function ParticleSystem:setLinearAcceleration(xmin, ymin, xmax, ymax) end
---
---Sets the amount of linear damping (constant deceleration) for particles.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:setLinearDamping)
---
---@param min number # The minimum amount of linear damping applied to particles.
---@param max? number # The maximum amount of linear damping applied to particles.
function ParticleSystem:setLinearDamping(min, max) end
---
---Set the offset position which the particle sprite is rotated around.
---
---If this function is not used, the particles rotate around their center.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:setOffset)
---
---@param x number # The x coordinate of the rotation offset.
---@param y number # The y coordinate of the rotation offset.
function ParticleSystem:setOffset(x, y) end
---
---Sets the lifetime of the particles.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:setParticleLifetime)
---
---@param min number # The minimum life of the particles (in seconds).
---@param max? number # The maximum life of the particles (in seconds).
function ParticleSystem:setParticleLifetime(min, max) end
---
---Sets the position of the emitter.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:setPosition)
---
---@param x number # Position along x-axis.
---@param y number # Position along y-axis.
function ParticleSystem:setPosition(x, y) end
---
---Sets a series of Quads to use for the particle sprites. Particles will choose a Quad from the list based on the particle's current lifetime, allowing for the use of animated sprite sheets with ParticleSystems.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:setQuads)
---
---@overload fun(self: love.ParticleSystem, quads: table)
---@param quad1 love.Quad # The first Quad to use.
---@param quad2 love.Quad # The second Quad to use.
function ParticleSystem:setQuads(quad1, quad2) end
---
---Set the radial acceleration (away from the emitter).
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:setRadialAcceleration)
---
---@param min number # The minimum acceleration.
---@param max? number # The maximum acceleration.
function ParticleSystem:setRadialAcceleration(min, max) end
---
---Sets whether particle angles and rotations are relative to their velocities. If enabled, particles are aligned to the angle of their velocities and rotate relative to that angle.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:setRelativeRotation)
---
---@param enable boolean # True to enable relative particle rotation, false to disable it.
function ParticleSystem:setRelativeRotation(enable) end
---
---Sets the rotation of the image upon particle creation (in radians).
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:setRotation)
---
---@param min number # The minimum initial angle (radians).
---@param max? number # The maximum initial angle (radians).
function ParticleSystem:setRotation(min, max) end
---
---Sets the amount of size variation (0 meaning no variation and 1 meaning full variation between start and end).
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:setSizeVariation)
---
---@param variation number # The amount of variation (0 meaning no variation and 1 meaning full variation between start and end).
function ParticleSystem:setSizeVariation(variation) end
---
---Sets a series of sizes by which to scale a particle sprite. 1.0 is normal size. The particle system will interpolate between each size evenly over the particle's lifetime.
---
---At least one size must be specified. A maximum of eight may be used.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:setSizes)
---
---@param size1 number # The first size.
---@param size2? number # The second size.
---@param size8? number # The eighth size.
function ParticleSystem:setSizes(size1, size2, size8) end
---
---Sets the speed of the particles.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:setSpeed)
---
---@param min number # The minimum linear speed of the particles.
---@param max? number # The maximum linear speed of the particles.
function ParticleSystem:setSpeed(min, max) end
---
---Sets the spin of the sprite.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:setSpin)
---
---@param min number # The minimum spin (radians per second).
---@param max? number # The maximum spin (radians per second).
function ParticleSystem:setSpin(min, max) end
---
---Sets the amount of spin variation (0 meaning no variation and 1 meaning full variation between start and end).
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:setSpinVariation)
---
---@param variation number # The amount of variation (0 meaning no variation and 1 meaning full variation between start and end).
function ParticleSystem:setSpinVariation(variation) end
---
---Sets the amount of spread for the system.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:setSpread)
---
---@param spread number # The amount of spread (radians).
function ParticleSystem:setSpread(spread) end
---
---Sets the tangential acceleration (acceleration perpendicular to the particle's direction).
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:setTangentialAcceleration)
---
---@param min number # The minimum acceleration.
---@param max? number # The maximum acceleration.
function ParticleSystem:setTangentialAcceleration(min, max) end
---
---Sets the texture (Image or Canvas) to be used for the particles.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:setTexture)
---
---@param texture love.Texture # An Image or Canvas to use for the particles.
function ParticleSystem:setTexture(texture) end
---
---Starts the particle emitter.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:start)
---
function ParticleSystem:start() end
---
---Stops the particle emitter, resetting the lifetime counter.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:stop)
---
function ParticleSystem:stop() end
---
---Updates the particle system; moving, creating and killing particles.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleSystem:update)
---
---@param dt number # The time (seconds) since last frame.
function ParticleSystem:update(dt) end
---
---A quadrilateral (a polygon with four sides and four corners) with texture coordinate information.
---
---Quads can be used to select part of a texture to draw. In this way, one large texture atlas can be loaded, and then split up into sub-images.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics)
---
---@class love.Quad: love.Object
local Quad = {}
---
---Gets reference texture dimensions initially specified in love.graphics.newQuad.
---
---
---[Open in Browser](https://love2d.org/wiki/Quad:getTextureDimensions)
---
---@return number sw # The Texture width used by the Quad.
---@return number sh # The Texture height used by the Quad.
function Quad:getTextureDimensions() end
---
---Gets the current viewport of this Quad.
---
---
---[Open in Browser](https://love2d.org/wiki/Quad:getViewport)
---
---@return number x # The top-left corner along the x-axis.
---@return number y # The top-left corner along the y-axis.
---@return number w # The width of the viewport.
---@return number h # The height of the viewport.
function Quad:getViewport() end
---
---Sets the texture coordinates according to a viewport.
---
---
---[Open in Browser](https://love2d.org/wiki/Quad:setViewport)
---
---@param x number # The top-left corner along the x-axis.
---@param y number # The top-left corner along the y-axis.
---@param w number # The width of the viewport.
---@param h number # The height of the viewport.
---@param sw number # The reference width, the width of the Image. (Must be greater than 0.)
---@param sh number # The reference height, the height of the Image. (Must be greater than 0.)
function Quad:setViewport(x, y, w, h, sw, sh) end
---
---A Shader is used for advanced hardware-accelerated pixel or vertex manipulation. These effects are written in a language based on GLSL (OpenGL Shading Language) with a few things simplified for easier coding.
---
---Potential uses for shaders include HDR/bloom, motion blur, grayscale/invert/sepia/any kind of color effect, reflection/refraction, distortions, bump mapping, and much more! Here is a collection of basic shaders and good starting point to learn: https://github.com/vrld/moonshine
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics)
---
---@class love.Shader: love.Object
local Shader = {}
---
---Returns any warning and error messages from compiling the shader code. This can be used for debugging your shaders if there's anything the graphics hardware doesn't like.
---
---
---[Open in Browser](https://love2d.org/wiki/Shader:getWarnings)
---
---@return string warnings # Warning and error messages (if any).
function Shader:getWarnings() end
---
---Gets whether a uniform / extern variable exists in the Shader.
---
---If a graphics driver's shader compiler determines that a uniform / extern variable doesn't affect the final output of the shader, it may optimize the variable out. This function will return false in that case.
---
---
---[Open in Browser](https://love2d.org/wiki/Shader:hasUniform)
---
---@param name string # The name of the uniform variable.
---@return boolean hasuniform # Whether the uniform exists in the shader and affects its final output.
function Shader:hasUniform(name) end
---
---Sends one or more values to a special (''uniform'') variable inside the shader. Uniform variables have to be marked using the ''uniform'' or ''extern'' keyword, e.g.
---
---uniform float time; // 'float' is the typical number type used in GLSL shaders.
---
---uniform float varsvec2 light_pos;
---
---uniform vec4 colors[4;
---
---The corresponding send calls would be
---
---shader:send('time', t)
---
---shader:send('vars',a,b)
---
---shader:send('light_pos', {light_x, light_y})
---
---shader:send('colors', {r1, g1, b1, a1}, {r2, g2, b2, a2}, {r3, g3, b3, a3}, {r4, g4, b4, a4})
---
---Uniform / extern variables are read-only in the shader code and remain constant until modified by a Shader:send call. Uniform variables can be accessed in both the Vertex and Pixel components of a shader, as long as the variable is declared in each.
---
---
---[Open in Browser](https://love2d.org/wiki/Shader:send)
---
---@overload fun(self: love.Shader, name: string, vector: table, ...)
---@overload fun(self: love.Shader, name: string, matrix: table, ...)
---@overload fun(self: love.Shader, name: string, texture: love.Texture)
---@overload fun(self: love.Shader, name: string, boolean: boolean, ...)
---@overload fun(self: love.Shader, name: string, matrixlayout: love.MatrixLayout, matrix: table, ...)
---@overload fun(self: love.Shader, name: string, data: love.Data, offset?: number, size?: number)
---@overload fun(self: love.Shader, name: string, data: love.Data, matrixlayout: love.MatrixLayout, offset?: number, size?: number)
---@overload fun(self: love.Shader, name: string, matrixlayout: love.MatrixLayout, data: love.Data, offset?: number, size?: number)
---@param name string # Name of the number to send to the shader.
---@param number number # Number to send to store in the uniform variable.
---@vararg number # Additional numbers to send if the uniform variable is an array.
function Shader:send(name, number, ...) end
---
---Sends one or more colors to a special (''extern'' / ''uniform'') vec3 or vec4 variable inside the shader. The color components must be in the range of 1. The colors are gamma-corrected if global gamma-correction is enabled.
---
---Extern variables must be marked using the ''extern'' keyword, e.g.
---
---extern vec4 Color;
---
---The corresponding sendColor call would be
---
---shader:sendColor('Color', {r, g, b, a})
---
---Extern variables can be accessed in both the Vertex and Pixel stages of a shader, as long as the variable is declared in each.
---
---In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.
---
---
---[Open in Browser](https://love2d.org/wiki/Shader:sendColor)
---
---@param name string # The name of the color extern variable to send to in the shader.
---@param color table # A table with red, green, blue, and optional alpha color components in the range of 1 to send to the extern as a vector.
---@vararg table # Additional colors to send in case the extern is an array. All colors need to be of the same size (e.g. only vec3's).
function Shader:sendColor(name, color, ...) end
---
---Using a single image, draw any number of identical copies of the image using a single call to love.graphics.draw(). This can be used, for example, to draw repeating copies of a single background image with high performance.
---
---A SpriteBatch can be even more useful when the underlying image is a texture atlas (a single image file containing many independent images); by adding Quads to the batch, different sub-images from within the atlas can be drawn.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics)
---
---@class love.SpriteBatch: love.Drawable, love.Object
local SpriteBatch = {}
---
---Adds a sprite to the batch. Sprites are drawn in the order they are added.
---
---
---[Open in Browser](https://love2d.org/wiki/SpriteBatch:add)
---
---@overload fun(self: love.SpriteBatch, quad: love.Quad, x: number, y: number, r?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number):number
---@param x number # The position to draw the object (x-axis).
---@param y number # The position to draw the object (y-axis).
---@param r? number # Orientation (radians).
---@param sx? number # Scale factor (x-axis).
---@param sy? number # Scale factor (y-axis).
---@param ox? number # Origin offset (x-axis).
---@param oy? number # Origin offset (y-axis).
---@param kx? number # Shear factor (x-axis).
---@param ky? number # Shear factor (y-axis).
---@return number id # An identifier for the added sprite.
function SpriteBatch:add(x, y, r, sx, sy, ox, oy, kx, ky) end
---
---Adds a sprite to a batch created with an Array Texture.
---
---
---[Open in Browser](https://love2d.org/wiki/SpriteBatch:addLayer)
---
---@overload fun(self: love.SpriteBatch, layerindex: number, quad: love.Quad, x?: number, y?: number, r?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number):number
---@overload fun(self: love.SpriteBatch, layerindex: number, transform: love.Transform):number
---@overload fun(self: love.SpriteBatch, layerindex: number, quad: love.Quad, transform: love.Transform):number
---@param layerindex number # The index of the layer to use for this sprite.
---@param x? number # The position to draw the sprite (x-axis).
---@param y? number # The position to draw the sprite (y-axis).
---@param r? number # Orientation (radians).
---@param sx? number # Scale factor (x-axis).
---@param sy? number # Scale factor (y-axis).
---@param ox? number # Origin offset (x-axis).
---@param oy? number # Origin offset (y-axis).
---@param kx? number # Shearing factor (x-axis).
---@param ky? number # Shearing factor (y-axis).
---@return number spriteindex # The index of the added sprite, for use with SpriteBatch:set or SpriteBatch:setLayer.
function SpriteBatch:addLayer(layerindex, x, y, r, sx, sy, ox, oy, kx, ky) end
---
---Attaches a per-vertex attribute from a Mesh onto this SpriteBatch, for use when drawing. This can be combined with a Shader to augment a SpriteBatch with per-vertex or additional per-sprite information instead of just having per-sprite colors.
---
---Each sprite in a SpriteBatch has 4 vertices in the following order: top-left, bottom-left, top-right, bottom-right. The index returned by SpriteBatch:add (and used by SpriteBatch:set) can used to determine the first vertex of a specific sprite with the formula 1 + 4 * ( id - 1 ).
---
---
---[Open in Browser](https://love2d.org/wiki/SpriteBatch:attachAttribute)
---
---@param name string # The name of the vertex attribute to attach.
---@param mesh love.Mesh # The Mesh to get the vertex attribute from.
function SpriteBatch:attachAttribute(name, mesh) end
---
---Removes all sprites from the buffer.
---
---
---[Open in Browser](https://love2d.org/wiki/SpriteBatch:clear)
---
function SpriteBatch:clear() end
---
---Immediately sends all new and modified sprite data in the batch to the graphics card.
---
---Normally it isn't necessary to call this method as love.graphics.draw(spritebatch, ...) will do it automatically if needed, but explicitly using SpriteBatch:flush gives more control over when the work happens.
---
---If this method is used, it generally shouldn't be called more than once (at most) between love.graphics.draw(spritebatch, ...) calls.
---
---
---[Open in Browser](https://love2d.org/wiki/SpriteBatch:flush)
---
function SpriteBatch:flush() end
---
---Gets the maximum number of sprites the SpriteBatch can hold.
---
---
---[Open in Browser](https://love2d.org/wiki/SpriteBatch:getBufferSize)
---
---@return number size # The maximum number of sprites the batch can hold.
function SpriteBatch:getBufferSize() end
---
---Gets the color that will be used for the next add and set operations.
---
---If no color has been set with SpriteBatch:setColor or the current SpriteBatch color has been cleared, this method will return nil.
---
---In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.
---
---
---[Open in Browser](https://love2d.org/wiki/SpriteBatch:getColor)
---
---@return number r # The red component (0-1).
---@return number g # The green component (0-1).
---@return number b # The blue component (0-1).
---@return number a # The alpha component (0-1).
function SpriteBatch:getColor() end
---
---Gets the number of sprites currently in the SpriteBatch.
---
---
---[Open in Browser](https://love2d.org/wiki/SpriteBatch:getCount)
---
---@return number count # The number of sprites currently in the batch.
function SpriteBatch:getCount() end
---
---Gets the texture (Image or Canvas) used by the SpriteBatch.
---
---
---[Open in Browser](https://love2d.org/wiki/SpriteBatch:getTexture)
---
---@return love.Texture texture # The Image or Canvas used by the SpriteBatch.
function SpriteBatch:getTexture() end
---
---Changes a sprite in the batch. This requires the sprite index returned by SpriteBatch:add or SpriteBatch:addLayer.
---
---
---[Open in Browser](https://love2d.org/wiki/SpriteBatch:set)
---
---@overload fun(self: love.SpriteBatch, spriteindex: number, quad: love.Quad, x: number, y: number, r?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number)
---@param spriteindex number # The index of the sprite that will be changed.
---@param x number # The position to draw the object (x-axis).
---@param y number # The position to draw the object (y-axis).
---@param r? number # Orientation (radians).
---@param sx? number # Scale factor (x-axis).
---@param sy? number # Scale factor (y-axis).
---@param ox? number # Origin offset (x-axis).
---@param oy? number # Origin offset (y-axis).
---@param kx? number # Shear factor (x-axis).
---@param ky? number # Shear factor (y-axis).
function SpriteBatch:set(spriteindex, x, y, r, sx, sy, ox, oy, kx, ky) end
---
---Sets the color that will be used for the next add and set operations. Calling the function without arguments will disable all per-sprite colors for the SpriteBatch.
---
---In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.
---
---In version 0.9.2 and older, the global color set with love.graphics.setColor will not work on the SpriteBatch if any of the sprites has its own color.
---
---
---[Open in Browser](https://love2d.org/wiki/SpriteBatch:setColor)
---
---@overload fun(self: love.SpriteBatch)
---@param r number # The amount of red.
---@param g number # The amount of green.
---@param b number # The amount of blue.
---@param a? number # The amount of alpha.
function SpriteBatch:setColor(r, g, b, a) end
---
---Restricts the drawn sprites in the SpriteBatch to a subset of the total.
---
---
---[Open in Browser](https://love2d.org/wiki/SpriteBatch:setDrawRange)
---
---@overload fun(self: love.SpriteBatch)
---@param start number # The index of the first sprite to draw. Index 1 corresponds to the first sprite added with SpriteBatch:add.
---@param count number # The number of sprites to draw.
function SpriteBatch:setDrawRange(start, count) end
---
---Changes a sprite previously added with add or addLayer, in a batch created with an Array Texture.
---
---
---[Open in Browser](https://love2d.org/wiki/SpriteBatch:setLayer)
---
---@overload fun(self: love.SpriteBatch, spriteindex: number, layerindex: number, quad: love.Quad, x?: number, y?: number, r?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number)
---@overload fun(self: love.SpriteBatch, spriteindex: number, layerindex: number, transform: love.Transform)
---@overload fun(self: love.SpriteBatch, spriteindex: number, layerindex: number, quad: love.Quad, transform: love.Transform)
---@param spriteindex number # The index of the existing sprite to replace.
---@param layerindex number # The index of the layer in the Array Texture to use for this sprite.
---@param x? number # The position to draw the sprite (x-axis).
---@param y? number # The position to draw the sprite (y-axis).
---@param r? number # Orientation (radians).
---@param sx? number # Scale factor (x-axis).
---@param sy? number # Scale factor (y-axis).
---@param ox? number # Origin offset (x-axis).
---@param oy? number # Origin offset (y-axis).
---@param kx? number # Shearing factor (x-axis).
---@param ky? number # Shearing factor (y-axis).
function SpriteBatch:setLayer(spriteindex, layerindex, x, y, r, sx, sy, ox, oy, kx, ky) end
---
---Sets the texture (Image or Canvas) used for the sprites in the batch, when drawing.
---
---
---[Open in Browser](https://love2d.org/wiki/SpriteBatch:setTexture)
---
---@param texture love.Texture # The new Image or Canvas to use for the sprites in the batch.
function SpriteBatch:setTexture(texture) end
---
---Drawable text.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics)
---
---@class love.Text: love.Drawable, love.Object
local Text = {}
---
---Adds additional colored text to the Text object at the specified position.
---
---
---[Open in Browser](https://love2d.org/wiki/Text:add)
---
---@overload fun(self: love.Text, coloredtext: table, x?: number, y?: number, angle?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number):number
---@param textstring string # The text to add to the object.
---@param x? number # The position of the new text on the x-axis.
---@param y? number # The position of the new text on the y-axis.
---@param angle? number # The orientation of the new text in radians.
---@param sx? number # Scale factor on the x-axis.
---@param sy? number # Scale factor on the y-axis.
---@param ox? number # Origin offset on the x-axis.
---@param oy? number # Origin offset on the y-axis.
---@param kx? number # Shearing / skew factor on the x-axis.
---@param ky? number # Shearing / skew factor on the y-axis.
---@return number index # An index number that can be used with Text:getWidth or Text:getHeight.
function Text:add(textstring, x, y, angle, sx, sy, ox, oy, kx, ky) end
---
---Adds additional formatted / colored text to the Text object at the specified position.
---
---The word wrap limit is applied before any scaling, rotation, and other coordinate transformations. Therefore the amount of text per line stays constant given the same wrap limit, even if the scale arguments change.
---
---
---[Open in Browser](https://love2d.org/wiki/Text:addf)
---
---@overload fun(self: love.Text, coloredtext: table, wraplimit: number, align: love.AlignMode, x: number, y: number, angle?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number):number
---@param textstring string # The text to add to the object.
---@param wraplimit number # The maximum width in pixels of the text before it gets automatically wrapped to a new line.
---@param align love.AlignMode # The alignment of the text.
---@param x number # The position of the new text (x-axis).
---@param y number # The position of the new text (y-axis).
---@param angle? number # Orientation (radians).
---@param sx? number # Scale factor (x-axis).
---@param sy? number # Scale factor (y-axis).
---@param ox? number # Origin offset (x-axis).
---@param oy? number # Origin offset (y-axis).
---@param kx? number # Shearing / skew factor (x-axis).
---@param ky? number # Shearing / skew factor (y-axis).
---@return number index # An index number that can be used with Text:getWidth or Text:getHeight.
function Text:addf(textstring, wraplimit, align, x, y, angle, sx, sy, ox, oy, kx, ky) end
---
---Clears the contents of the Text object.
---
---
---[Open in Browser](https://love2d.org/wiki/Text:clear)
---
function Text:clear() end
---
---Gets the width and height of the text in pixels.
---
---
---[Open in Browser](https://love2d.org/wiki/Text:getDimensions)
---
---@overload fun(self: love.Text, index: number):number, number
---@return number width # The width of the text. If multiple sub-strings have been added with Text:add, the width of the last sub-string is returned.
---@return number height # The height of the text. If multiple sub-strings have been added with Text:add, the height of the last sub-string is returned.
function Text:getDimensions() end
---
---Gets the Font used with the Text object.
---
---
---[Open in Browser](https://love2d.org/wiki/Text:getFont)
---
---@return love.Font font # The font used with this Text object.
function Text:getFont() end
---
---Gets the height of the text in pixels.
---
---
---[Open in Browser](https://love2d.org/wiki/Text:getHeight)
---
---@overload fun(self: love.Text, index: number):number
---@return number height # The height of the text. If multiple sub-strings have been added with Text:add, the height of the last sub-string is returned.
function Text:getHeight() end
---
---Gets the width of the text in pixels.
---
---
---[Open in Browser](https://love2d.org/wiki/Text:getWidth)
---
---@overload fun(self: love.Text, index: number):number
---@return number width # The width of the text. If multiple sub-strings have been added with Text:add, the width of the last sub-string is returned.
function Text:getWidth() end
---
---Replaces the contents of the Text object with a new unformatted string.
---
---
---[Open in Browser](https://love2d.org/wiki/Text:set)
---
---@overload fun(self: love.Text, coloredtext: table)
---@param textstring string # The new string of text to use.
function Text:set(textstring) end
---
---Replaces the Font used with the text.
---
---
---[Open in Browser](https://love2d.org/wiki/Text:setFont)
---
---@param font love.Font # The new font to use with this Text object.
function Text:setFont(font) end
---
---Replaces the contents of the Text object with a new formatted string.
---
---
---[Open in Browser](https://love2d.org/wiki/Text:setf)
---
---@overload fun(self: love.Text, coloredtext: table, wraplimit: number, align: love.AlignMode)
---@param textstring string # The new string of text to use.
---@param wraplimit number # The maximum width in pixels of the text before it gets automatically wrapped to a new line.
---@param align love.AlignMode # The alignment of the text.
function Text:setf(textstring, wraplimit, align) end
---
---Superclass for drawable objects which represent a texture. All Textures can be drawn with Quads. This is an abstract type that can't be created directly.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics)
---
---@class love.Texture: love.Drawable, love.Object
local Texture = {}
---
---Gets the DPI scale factor of the Texture.
---
---The DPI scale factor represents relative pixel density. A DPI scale factor of 2 means the texture has twice the pixel density in each dimension (4 times as many pixels in the same area) compared to a texture with a DPI scale factor of 1.
---
---For example, a texture with pixel dimensions of 100x100 with a DPI scale factor of 2 will be drawn as if it was 50x50. This is useful with high-dpi / retina displays to easily allow swapping out higher or lower pixel density Images and Canvases without needing any extra manual scaling logic.
---
---
---[Open in Browser](https://love2d.org/wiki/Texture:getDPIScale)
---
---@return number dpiscale # The DPI scale factor of the Texture.
function Texture:getDPIScale() end
---
---Gets the depth of a Volume Texture. Returns 1 for 2D, Cubemap, and Array textures.
---
---
---[Open in Browser](https://love2d.org/wiki/Texture:getDepth)
---
---@return number depth # The depth of the volume Texture.
function Texture:getDepth() end
---
---Gets the comparison mode used when sampling from a depth texture in a shader.
---
---Depth texture comparison modes are advanced low-level functionality typically used with shadow mapping in 3D.
---
---
---[Open in Browser](https://love2d.org/wiki/Texture:getDepthSampleMode)
---
---@return love.CompareMode compare # The comparison mode used when sampling from this texture in a shader, or nil if setDepthSampleMode has not been called on this Texture.
function Texture:getDepthSampleMode() end
---
---Gets the width and height of the Texture.
---
---
---[Open in Browser](https://love2d.org/wiki/Texture:getDimensions)
---
---@return number width # The width of the Texture.
---@return number height # The height of the Texture.
function Texture:getDimensions() end
---
---Gets the filter mode of the Texture.
---
---
---[Open in Browser](https://love2d.org/wiki/Texture:getFilter)
---
---@return love.FilterMode min # Filter mode to use when minifying the texture (rendering it at a smaller size on-screen than its size in pixels).
---@return love.FilterMode mag # Filter mode to use when magnifying the texture (rendering it at a smaller size on-screen than its size in pixels).
---@return number anisotropy # Maximum amount of anisotropic filtering used.
function Texture:getFilter() end
---
---Gets the pixel format of the Texture.
---
---
---[Open in Browser](https://love2d.org/wiki/Texture:getFormat)
---
---@return love.PixelFormat format # The pixel format the Texture was created with.
function Texture:getFormat() end
---
---Gets the height of the Texture.
---
---
---[Open in Browser](https://love2d.org/wiki/Texture:getHeight)
---
---@return number height # The height of the Texture.
function Texture:getHeight() end
---
---Gets the number of layers / slices in an Array Texture. Returns 1 for 2D, Cubemap, and Volume textures.
---
---
---[Open in Browser](https://love2d.org/wiki/Texture:getLayerCount)
---
---@return number layers # The number of layers in the Array Texture.
function Texture:getLayerCount() end
---
---Gets the number of mipmaps contained in the Texture. If the texture was not created with mipmaps, it will return 1.
---
---
---[Open in Browser](https://love2d.org/wiki/Texture:getMipmapCount)
---
---@return number mipmaps # The number of mipmaps in the Texture.
function Texture:getMipmapCount() end
---
---Gets the mipmap filter mode for a Texture. Prior to 11.0 this method only worked on Images.
---
---
---[Open in Browser](https://love2d.org/wiki/Texture:getMipmapFilter)
---
---@return love.FilterMode mode # The filter mode used in between mipmap levels. nil if mipmap filtering is not enabled.
---@return number sharpness # Value used to determine whether the image should use more or less detailed mipmap levels than normal when drawing.
function Texture:getMipmapFilter() end
---
---Gets the width and height in pixels of the Texture.
---
---Texture:getDimensions gets the dimensions of the texture in units scaled by the texture's DPI scale factor, rather than pixels. Use getDimensions for calculations related to drawing the texture (calculating an origin offset, for example), and getPixelDimensions only when dealing specifically with pixels, for example when using Canvas:newImageData.
---
---
---[Open in Browser](https://love2d.org/wiki/Texture:getPixelDimensions)
---
---@return number pixelwidth # The width of the Texture, in pixels.
---@return number pixelheight # The height of the Texture, in pixels.
function Texture:getPixelDimensions() end
---
---Gets the height in pixels of the Texture.
---
---DPI scale factor, rather than pixels. Use getHeight for calculations related to drawing the texture (calculating an origin offset, for example), and getPixelHeight only when dealing specifically with pixels, for example when using Canvas:newImageData.
---
---
---[Open in Browser](https://love2d.org/wiki/Texture:getPixelHeight)
---
---@return number pixelheight # The height of the Texture, in pixels.
function Texture:getPixelHeight() end
---
---Gets the width in pixels of the Texture.
---
---DPI scale factor, rather than pixels. Use getWidth for calculations related to drawing the texture (calculating an origin offset, for example), and getPixelWidth only when dealing specifically with pixels, for example when using Canvas:newImageData.
---
---
---[Open in Browser](https://love2d.org/wiki/Texture:getPixelWidth)
---
---@return number pixelwidth # The width of the Texture, in pixels.
function Texture:getPixelWidth() end
---
---Gets the type of the Texture.
---
---
---[Open in Browser](https://love2d.org/wiki/Texture:getTextureType)
---
---@return love.TextureType texturetype # The type of the Texture.
function Texture:getTextureType() end
---
---Gets the width of the Texture.
---
---
---[Open in Browser](https://love2d.org/wiki/Texture:getWidth)
---
---@return number width # The width of the Texture.
function Texture:getWidth() end
---
---Gets the wrapping properties of a Texture.
---
---This function returns the currently set horizontal and vertical wrapping modes for the texture.
---
---
---[Open in Browser](https://love2d.org/wiki/Texture:getWrap)
---
---@return love.WrapMode horiz # Horizontal wrapping mode of the texture.
---@return love.WrapMode vert # Vertical wrapping mode of the texture.
---@return love.WrapMode depth # Wrapping mode for the z-axis of a Volume texture.
function Texture:getWrap() end
---
---Gets whether the Texture can be drawn and sent to a Shader.
---
---Canvases created with stencil and/or depth PixelFormats are not readable by default, unless readable=true is specified in the settings table passed into love.graphics.newCanvas.
---
---Non-readable Canvases can still be rendered to.
---
---
---[Open in Browser](https://love2d.org/wiki/Texture:isReadable)
---
---@return boolean readable # Whether the Texture is readable.
function Texture:isReadable() end
---
---Sets the comparison mode used when sampling from a depth texture in a shader. Depth texture comparison modes are advanced low-level functionality typically used with shadow mapping in 3D.
---
---When using a depth texture with a comparison mode set in a shader, it must be declared as a sampler2DShadow and used in a GLSL 3 Shader. The result of accessing the texture in the shader will return a float between 0 and 1, proportional to the number of samples (up to 4 samples will be used if bilinear filtering is enabled) that passed the test set by the comparison operation.
---
---Depth texture comparison can only be used with readable depth-formatted Canvases.
---
---
---[Open in Browser](https://love2d.org/wiki/Texture:setDepthSampleMode)
---
---@param compare love.CompareMode # The comparison mode used when sampling from this texture in a shader.
function Texture:setDepthSampleMode(compare) end
---
---Sets the filter mode of the Texture.
---
---
---[Open in Browser](https://love2d.org/wiki/Texture:setFilter)
---
---@param min love.FilterMode # Filter mode to use when minifying the texture (rendering it at a smaller size on-screen than its size in pixels).
---@param mag love.FilterMode # Filter mode to use when magnifying the texture (rendering it at a larger size on-screen than its size in pixels).
---@param anisotropy? number # Maximum amount of anisotropic filtering to use.
function Texture:setFilter(min, mag, anisotropy) end
---
---Sets the mipmap filter mode for a Texture. Prior to 11.0 this method only worked on Images.
---
---Mipmapping is useful when drawing a texture at a reduced scale. It can improve performance and reduce aliasing issues.
---
---In created with the mipmaps flag enabled for the mipmap filter to have any effect. In versions prior to 0.10.0 it's best to call this method directly after creating the image with love.graphics.newImage, to avoid bugs in certain graphics drivers.
---
---Due to hardware restrictions and driver bugs, in versions prior to 0.10.0 images that weren't loaded from a CompressedData must have power-of-two dimensions (64x64, 512x256, etc.) to use mipmaps.
---
---
---[Open in Browser](https://love2d.org/wiki/Texture:setMipmapFilter)
---
---@overload fun(self: love.Texture)
---@param filtermode love.FilterMode # The filter mode to use in between mipmap levels. 'nearest' will often give better performance.
---@param sharpness? number # A positive sharpness value makes the texture use a more detailed mipmap level when drawing, at the expense of performance. A negative value does the reverse.
function Texture:setMipmapFilter(filtermode, sharpness) end
---
---Sets the wrapping properties of a Texture.
---
---This function sets the way a Texture is repeated when it is drawn with a Quad that is larger than the texture's extent, or when a custom Shader is used which uses texture coordinates outside of [0, 1]. A texture may be clamped or set to repeat in both horizontal and vertical directions.
---
---Clamped textures appear only once (with the edges of the texture stretching to fill the extent of the Quad), whereas repeated ones repeat as many times as there is room in the Quad.
---
---
---[Open in Browser](https://love2d.org/wiki/Texture:setWrap)
---
---@param horiz love.WrapMode # Horizontal wrapping mode of the texture.
---@param vert? love.WrapMode # Vertical wrapping mode of the texture.
---@param depth? love.WrapMode # Wrapping mode for the z-axis of a Volume texture.
function Texture:setWrap(horiz, vert, depth) end
---
---A drawable video.
---
---
---[Open in Browser](https://love2d.org/wiki/love.graphics)
---
---@class love.Video: love.Drawable, love.Object
local Video = {}
---
---Gets the width and height of the Video in pixels.
---
---
---[Open in Browser](https://love2d.org/wiki/Video:getDimensions)
---
---@return number width # The width of the Video.
---@return number height # The height of the Video.
function Video:getDimensions() end
---
---Gets the scaling filters used when drawing the Video.
---
---
---[Open in Browser](https://love2d.org/wiki/Video:getFilter)
---
---@return love.FilterMode min # The filter mode used when scaling the Video down.
---@return love.FilterMode mag # The filter mode used when scaling the Video up.
---@return number anisotropy # Maximum amount of anisotropic filtering used.
function Video:getFilter() end
---
---Gets the height of the Video in pixels.
---
---
---[Open in Browser](https://love2d.org/wiki/Video:getHeight)
---
---@return number height # The height of the Video.
function Video:getHeight() end
---
---Gets the audio Source used for playing back the video's audio. May return nil if the video has no audio, or if Video:setSource is called with a nil argument.
---
---
---[Open in Browser](https://love2d.org/wiki/Video:getSource)
---
---@return love.Source source # The audio Source used for audio playback, or nil if the video has no audio.
function Video:getSource() end
---
---Gets the VideoStream object used for decoding and controlling the video.
---
---
---[Open in Browser](https://love2d.org/wiki/Video:getStream)
---
---@return love.VideoStream stream # The VideoStream used for decoding and controlling the video.
function Video:getStream() end
---
---Gets the width of the Video in pixels.
---
---
---[Open in Browser](https://love2d.org/wiki/Video:getWidth)
---
---@return number width # The width of the Video.
function Video:getWidth() end
---
---Gets whether the Video is currently playing.
---
---
---[Open in Browser](https://love2d.org/wiki/Video:isPlaying)
---
---@return boolean playing # Whether the video is playing.
function Video:isPlaying() end
---
---Pauses the Video.
---
---
---[Open in Browser](https://love2d.org/wiki/Video:pause)
---
function Video:pause() end
---
---Starts playing the Video. In order for the video to appear onscreen it must be drawn with love.graphics.draw.
---
---
---[Open in Browser](https://love2d.org/wiki/Video:play)
---
function Video:play() end
---
---Rewinds the Video to the beginning.
---
---
---[Open in Browser](https://love2d.org/wiki/Video:rewind)
---
function Video:rewind() end
---
---Sets the current playback position of the Video.
---
---
---[Open in Browser](https://love2d.org/wiki/Video:seek)
---
---@param offset number # The time in seconds since the beginning of the Video.
function Video:seek(offset) end
---
---Sets the scaling filters used when drawing the Video.
---
---
---[Open in Browser](https://love2d.org/wiki/Video:setFilter)
---
---@param min love.FilterMode # The filter mode used when scaling the Video down.
---@param mag love.FilterMode # The filter mode used when scaling the Video up.
---@param anisotropy? number # Maximum amount of anisotropic filtering used.
function Video:setFilter(min, mag, anisotropy) end
---
---Sets the audio Source used for playing back the video's audio. The audio Source also controls playback speed and synchronization.
---
---
---[Open in Browser](https://love2d.org/wiki/Video:setSource)
---
---@param source? love.Source # The audio Source used for audio playback, or nil to disable audio synchronization.
function Video:setSource(source) end
---
---Gets the current playback position of the Video.
---
---
---[Open in Browser](https://love2d.org/wiki/Video:tell)
---
---@return number seconds # The time in seconds since the beginning of the Video.
function Video:tell() end
---
---Text alignment.
---
---
---[Open in Browser](https://love2d.org/wiki/AlignMode)
---
---@alias love.AlignMode
---
---Align text center.
---
---| "center"
---
---Align text left.
---
---| "left"
---
---Align text right.
---
---| "right"
---
---Align text both left and right.
---
---| "justify"
---
---Different types of arcs that can be drawn.
---
---
---[Open in Browser](https://love2d.org/wiki/ArcType)
---
---@alias love.ArcType
---
---The arc is drawn like a slice of pie, with the arc circle connected to the center at its end-points.
---
---| "pie"
---
---The arc circle's two end-points are unconnected when the arc is drawn as a line. Behaves like the "closed" arc type when the arc is drawn in filled mode.
---
---| "open"
---
---The arc circle's two end-points are connected to each other.
---
---| "closed"
---
---Types of particle area spread distribution.
---
---
---[Open in Browser](https://love2d.org/wiki/AreaSpreadDistribution)
---
---@alias love.AreaSpreadDistribution
---
---Uniform distribution.
---
---| "uniform"
---
---Normal (gaussian) distribution.
---
---| "normal"
---
---Uniform distribution in an ellipse.
---
---| "ellipse"
---
---Distribution in an ellipse with particles spawning at the edges of the ellipse.
---
---| "borderellipse"
---
---Distribution in a rectangle with particles spawning at the edges of the rectangle.
---
---| "borderrectangle"
---
---No distribution - area spread is disabled.
---
---| "none"
---
---Different ways alpha affects color blending. See BlendMode and the BlendMode Formulas for additional notes.
---
---
---[Open in Browser](https://love2d.org/wiki/BlendAlphaMode)
---
---@alias love.BlendAlphaMode
---
---The RGB values of what's drawn are multiplied by the alpha values of those colors during blending. This is the default alpha mode.
---
---| "alphamultiply"
---
---The RGB values of what's drawn are '''not''' multiplied by the alpha values of those colors during blending. For most blend modes to work correctly with this alpha mode, the colors of a drawn object need to have had their RGB values multiplied by their alpha values at some point previously ("premultiplied alpha").
---
---| "premultiplied"
---
---Different ways to do color blending. See BlendAlphaMode and the BlendMode Formulas for additional notes.
---
---
---[Open in Browser](https://love2d.org/wiki/BlendMode)
---
---@alias love.BlendMode
---
---Alpha blending (normal). The alpha of what's drawn determines its opacity.
---
---| "alpha"
---
---The colors of what's drawn completely replace what was on the screen, with no additional blending. The BlendAlphaMode specified in love.graphics.setBlendMode still affects what happens.
---
---| "replace"
---
---'Screen' blending.
---
---| "screen"
---
---The pixel colors of what's drawn are added to the pixel colors already on the screen. The alpha of the screen is not modified.
---
---| "add"
---
---The pixel colors of what's drawn are subtracted from the pixel colors already on the screen. The alpha of the screen is not modified.
---
---| "subtract"
---
---The pixel colors of what's drawn are multiplied with the pixel colors already on the screen (darkening them). The alpha of drawn objects is multiplied with the alpha of the screen rather than determining how much the colors on the screen are affected, even when the "alphamultiply" BlendAlphaMode is used.
---
---| "multiply"
---
---The pixel colors of what's drawn are compared to the existing pixel colors, and the larger of the two values for each color component is used. Only works when the "premultiplied" BlendAlphaMode is used in love.graphics.setBlendMode.
---
---| "lighten"
---
---The pixel colors of what's drawn are compared to the existing pixel colors, and the smaller of the two values for each color component is used. Only works when the "premultiplied" BlendAlphaMode is used in love.graphics.setBlendMode.
---
---| "darken"
---
---Additive blend mode.
---
---| "additive"
---
---Subtractive blend mode.
---
---| "subtractive"
---
---Multiply blend mode.
---
---| "multiplicative"
---
---Premultiplied alpha blend mode.
---
---| "premultiplied"
---
---Different types of per-pixel stencil test and depth test comparisons. The pixels of an object will be drawn if the comparison succeeds, for each pixel that the object touches.
---
---
---[Open in Browser](https://love2d.org/wiki/CompareMode)
---
---@alias love.CompareMode
---
---* stencil tests: the stencil value of the pixel must be equal to the supplied value.
---* depth tests: the depth value of the drawn object at that pixel must be equal to the existing depth value of that pixel.
---
---| "equal"
---
---* stencil tests: the stencil value of the pixel must not be equal to the supplied value.
---* depth tests: the depth value of the drawn object at that pixel must not be equal to the existing depth value of that pixel.
---
---| "notequal"
---
---* stencil tests: the stencil value of the pixel must be less than the supplied value.
---* depth tests: the depth value of the drawn object at that pixel must be less than the existing depth value of that pixel.
---
---| "less"
---
---* stencil tests: the stencil value of the pixel must be less than or equal to the supplied value.
---* depth tests: the depth value of the drawn object at that pixel must be less than or equal to the existing depth value of that pixel.
---
---| "lequal"
---
---* stencil tests: the stencil value of the pixel must be greater than or equal to the supplied value.
---* depth tests: the depth value of the drawn object at that pixel must be greater than or equal to the existing depth value of that pixel.
---
---| "gequal"
---
---* stencil tests: the stencil value of the pixel must be greater than the supplied value.
---* depth tests: the depth value of the drawn object at that pixel must be greater than the existing depth value of that pixel.
---
---| "greater"
---
---Objects will never be drawn.
---
---| "never"
---
---Objects will always be drawn. Effectively disables the depth or stencil test.
---
---| "always"
---
---How Mesh geometry is culled when rendering.
---
---
---[Open in Browser](https://love2d.org/wiki/CullMode)
---
---@alias love.CullMode
---
---Back-facing triangles in Meshes are culled (not rendered). The vertex order of a triangle determines whether it is back- or front-facing.
---
---| "back"
---
---Front-facing triangles in Meshes are culled.
---
---| "front"
---
---Both back- and front-facing triangles in Meshes are rendered.
---
---| "none"
---
---Controls whether shapes are drawn as an outline, or filled.
---
---
---[Open in Browser](https://love2d.org/wiki/DrawMode)
---
---@alias love.DrawMode
---
---Draw filled shape.
---
---| "fill"
---
---Draw outlined shape.
---
---| "line"
---
---How the image is filtered when scaling.
---
---
---[Open in Browser](https://love2d.org/wiki/FilterMode)
---
---@alias love.FilterMode
---
---Scale image with linear interpolation.
---
---| "linear"
---
---Scale image with nearest neighbor interpolation.
---
---| "nearest"
---
---Graphics features that can be checked for with love.graphics.getSupported.
---
---
---[Open in Browser](https://love2d.org/wiki/GraphicsFeature)
---
---@alias love.GraphicsFeature
---
---Whether the "clampzero" WrapMode is supported.
---
---| "clampzero"
---
---Whether the "lighten" and "darken" BlendModes are supported.
---
---| "lighten"
---
---Whether multiple formats can be used in the same love.graphics.setCanvas call.
---
---| "multicanvasformats"
---
---Whether GLSL 3 Shaders can be used.
---
---| "glsl3"
---
---Whether mesh instancing is supported.
---
---| "instancing"
---
---Whether textures with non-power-of-two dimensions can use mipmapping and the 'repeat' WrapMode.
---
---| "fullnpot"
---
---Whether pixel shaders can use "highp" 32 bit floating point numbers (as opposed to just 16 bit or lower precision).
---
---| "pixelshaderhighp"
---
---Whether shaders can use the dFdx, dFdy, and fwidth functions for computing derivatives.
---
---| "shaderderivatives"
---
---Types of system-dependent graphics limits checked for using love.graphics.getSystemLimits.
---
---
---[Open in Browser](https://love2d.org/wiki/GraphicsLimit)
---
---@alias love.GraphicsLimit
---
---The maximum size of points.
---
---| "pointsize"
---
---The maximum width or height of Images and Canvases.
---
---| "texturesize"
---
---The maximum number of simultaneously active canvases (via love.graphics.setCanvas.)
---
---| "multicanvas"
---
---The maximum number of antialiasing samples for a Canvas.
---
---| "canvasmsaa"
---
---The maximum number of layers in an Array texture.
---
---| "texturelayers"
---
---The maximum width, height, or depth of a Volume texture.
---
---| "volumetexturesize"
---
---The maximum width or height of a Cubemap texture.
---
---| "cubetexturesize"
---
---The maximum amount of anisotropic filtering. Texture:setMipmapFilter internally clamps the given anisotropy value to the system's limit.
---
---| "anisotropy"
---
---Vertex map datatype for Data variant of Mesh:setVertexMap.
---
---
---[Open in Browser](https://love2d.org/wiki/IndexDataType)
---
---@alias love.IndexDataType
---
---The vertex map is array of unsigned word (16-bit).
---
---| "uint16"
---
---The vertex map is array of unsigned dword (32-bit).
---
---| "uint32"
---
---Line join style.
---
---
---[Open in Browser](https://love2d.org/wiki/LineJoin)
---
---@alias love.LineJoin
---
---The ends of the line segments beveled in an angle so that they join seamlessly.
---
---| "miter"
---
---No cap applied to the ends of the line segments.
---
---| "none"
---
---Flattens the point where line segments join together.
---
---| "bevel"
---
---The styles in which lines are drawn.
---
---
---[Open in Browser](https://love2d.org/wiki/LineStyle)
---
---@alias love.LineStyle
---
---Draw rough lines.
---
---| "rough"
---
---Draw smooth lines.
---
---| "smooth"
---
---How a Mesh's vertices are used when drawing.
---
---
---[Open in Browser](https://love2d.org/wiki/MeshDrawMode)
---
---@alias love.MeshDrawMode
---
---The vertices create a "fan" shape with the first vertex acting as the hub point. Can be easily used to draw simple convex polygons.
---
---| "fan"
---
---The vertices create a series of connected triangles using vertices 1, 2, 3, then 3, 2, 4 (note the order), then 3, 4, 5, and so on.
---
---| "strip"
---
---The vertices create unconnected triangles.
---
---| "triangles"
---
---The vertices are drawn as unconnected points (see love.graphics.setPointSize.)
---
---| "points"
---
---Controls whether a Canvas has mipmaps, and its behaviour when it does.
---
---
---[Open in Browser](https://love2d.org/wiki/MipmapMode)
---
---@alias love.MipmapMode
---
---The Canvas has no mipmaps.
---
---| "none"
---
---The Canvas has mipmaps. love.graphics.setCanvas can be used to render to a specific mipmap level, or Canvas:generateMipmaps can (re-)compute all mipmap levels based on the base level.
---
---| "auto"
---
---The Canvas has mipmaps, and all mipmap levels will automatically be recomputed when switching away from the Canvas with love.graphics.setCanvas.
---
---| "manual"
---
---How newly created particles are added to the ParticleSystem.
---
---
---[Open in Browser](https://love2d.org/wiki/ParticleInsertMode)
---
---@alias love.ParticleInsertMode
---
---Particles are inserted at the top of the ParticleSystem's list of particles.
---
---| "top"
---
---Particles are inserted at the bottom of the ParticleSystem's list of particles.
---
---| "bottom"
---
---Particles are inserted at random positions in the ParticleSystem's list of particles.
---
---| "random"
---
---Usage hints for SpriteBatches and Meshes to optimize data storage and access.
---
---
---[Open in Browser](https://love2d.org/wiki/SpriteBatchUsage)
---
---@alias love.SpriteBatchUsage
---
---The object's data will change occasionally during its lifetime.
---
---| "dynamic"
---
---The object will not be modified after initial sprites or vertices are added.
---
---| "static"
---
---The object data will always change between draws.
---
---| "stream"
---
---Graphics state stack types used with love.graphics.push.
---
---
---[Open in Browser](https://love2d.org/wiki/StackType)
---
---@alias love.StackType
---
---The transformation stack (love.graphics.translate, love.graphics.rotate, etc.)
---
---| "transform"
---
---All love.graphics state, including transform state.
---
---| "all"
---
---How a stencil function modifies the stencil values of pixels it touches.
---
---
---[Open in Browser](https://love2d.org/wiki/StencilAction)
---
---@alias love.StencilAction
---
---The stencil value of a pixel will be replaced by the value specified in love.graphics.stencil, if any object touches the pixel.
---
---| "replace"
---
---The stencil value of a pixel will be incremented by 1 for each object that touches the pixel. If the stencil value reaches 255 it will stay at 255.
---
---| "increment"
---
---The stencil value of a pixel will be decremented by 1 for each object that touches the pixel. If the stencil value reaches 0 it will stay at 0.
---
---| "decrement"
---
---The stencil value of a pixel will be incremented by 1 for each object that touches the pixel. If a stencil value of 255 is incremented it will be set to 0.
---
---| "incrementwrap"
---
---The stencil value of a pixel will be decremented by 1 for each object that touches the pixel. If the stencil value of 0 is decremented it will be set to 255.
---
---| "decrementwrap"
---
---The stencil value of a pixel will be bitwise-inverted for each object that touches the pixel. If a stencil value of 0 is inverted it will become 255.
---
---| "invert"
---
---Types of textures (2D, cubemap, etc.)
---
---
---[Open in Browser](https://love2d.org/wiki/TextureType)
---
---@alias love.TextureType
---
---Regular 2D texture with width and height.
---
---| "2d"
---
---Several same-size 2D textures organized into a single object. Similar to a texture atlas / sprite sheet, but avoids sprite bleeding and other issues.
---
---| "array"
---
---Cubemap texture with 6 faces. Requires a custom shader (and Shader:send) to use. Sampling from a cube texture in a shader takes a 3D direction vector instead of a texture coordinate.
---
---| "cube"
---
---3D texture with width, height, and depth. Requires a custom shader to use. Volume textures can have texture filtering applied along the 3rd axis.
---
---| "volume"
---
---The frequency at which a vertex shader fetches the vertex attribute's data from the Mesh when it's drawn.
---
---Per-instance attributes can be used to render a Mesh many times with different positions, colors, or other attributes via a single love.graphics.drawInstanced call, without using the love_InstanceID vertex shader variable.
---
---
---[Open in Browser](https://love2d.org/wiki/VertexAttributeStep)
---
---@alias love.VertexAttributeStep
---
---The vertex attribute will have a unique value for each vertex in the Mesh.
---
---| "pervertex"
---
---The vertex attribute will have a unique value for each instance of the Mesh.
---
---| "perinstance"
---
---How Mesh geometry vertices are ordered.
---
---
---[Open in Browser](https://love2d.org/wiki/VertexWinding)
---
---@alias love.VertexWinding
---
---Clockwise.
---
---| "cw"
---
---Counter-clockwise.
---
---| "ccw"
---
---How the image wraps inside a Quad with a larger quad size than image size. This also affects how Meshes with texture coordinates which are outside the range of 1 are drawn, and the color returned by the Texel Shader function when using it to sample from texture coordinates outside of the range of 1.
---
---
---[Open in Browser](https://love2d.org/wiki/WrapMode)
---
---@alias love.WrapMode
---
---Clamp the texture. Appears only once. The area outside the texture's normal range is colored based on the edge pixels of the texture.
---
---| "clamp"
---
---Repeat the texture. Fills the whole available extent.
---
---| "repeat"
---
---Repeat the texture, flipping it each time it repeats. May produce better visual results than the repeat mode when the texture doesn't seamlessly tile.
---
---| "mirroredrepeat"
---
---Clamp the texture. Fills the area outside the texture's normal range with transparent black (or opaque black for textures with no alpha channel.)
---
---| "clampzero"
|