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
|
<?xml version="1.0" encoding="UTF-8" ?>
<class name="DisplayServer" inherits="Object" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<methods>
<method name="clipboard_get" qualifiers="const">
<return type="String" />
<description>
Returns the user's clipboard as a string if possible.
</description>
</method>
<method name="clipboard_get_primary" qualifiers="const">
<return type="String" />
<description>
Returns the user's primary clipboard as a string if possible.
[b]Note:[/b] This method is only implemented on Linux.
</description>
</method>
<method name="clipboard_has" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if there is content on the user's clipboard.
</description>
</method>
<method name="clipboard_set">
<return type="void" />
<argument index="0" name="clipboard" type="String" />
<description>
Sets the user's clipboard content to the given string.
</description>
</method>
<method name="clipboard_set_primary">
<return type="void" />
<argument index="0" name="clipboard_primary" type="String" />
<description>
Sets the user's primary clipboard content to the given string.
[b]Note:[/b] This method is only implemented on Linux.
</description>
</method>
<method name="create_sub_window">
<return type="int" />
<argument index="0" name="mode" type="int" enum="DisplayServer.WindowMode" />
<argument index="1" name="vsync_mode" type="int" enum="DisplayServer.VSyncMode" />
<argument index="2" name="flags" type="int" />
<argument index="3" name="rect" type="Rect2i" default="Rect2i(0, 0, 0, 0)" />
<description>
</description>
</method>
<method name="cursor_get_shape" qualifiers="const">
<return type="int" enum="DisplayServer.CursorShape" />
<description>
</description>
</method>
<method name="cursor_set_custom_image">
<return type="void" />
<argument index="0" name="cursor" type="Resource" />
<argument index="1" name="shape" type="int" enum="DisplayServer.CursorShape" default="0" />
<argument index="2" name="hotspot" type="Vector2" default="Vector2(0, 0)" />
<description>
</description>
</method>
<method name="cursor_set_shape">
<return type="void" />
<argument index="0" name="shape" type="int" enum="DisplayServer.CursorShape" />
<description>
</description>
</method>
<method name="delete_sub_window">
<return type="void" />
<argument index="0" name="window_id" type="int" />
<description>
</description>
</method>
<method name="dialog_input_text">
<return type="int" enum="Error" />
<argument index="0" name="title" type="String" />
<argument index="1" name="description" type="String" />
<argument index="2" name="existing_text" type="String" />
<argument index="3" name="callback" type="Callable" />
<description>
</description>
</method>
<method name="dialog_show">
<return type="int" enum="Error" />
<argument index="0" name="title" type="String" />
<argument index="1" name="description" type="String" />
<argument index="2" name="buttons" type="PackedStringArray" />
<argument index="3" name="callback" type="Callable" />
<description>
</description>
</method>
<method name="enable_for_stealing_focus">
<return type="void" />
<argument index="0" name="process_id" type="int" />
<description>
</description>
</method>
<method name="force_process_and_drop_events">
<return type="void" />
<description>
</description>
</method>
<method name="get_display_cutouts" qualifiers="const">
<return type="Array" />
<description>
Returns an [Array] of [Rect2], each of which is the bounding rectangle for a display cutout or notch. These are non-functional areas on edge-to-edge screens used by cameras and sensors. Returns an empty array if the device does not have cutouts. See also [method get_display_safe_area].
[b]Note:[/b] Currently only implemented on Android. Other platforms will return an empty array even if they do have display cutouts or notches.
</description>
</method>
<method name="get_display_safe_area" qualifiers="const">
<return type="Rect2i" />
<description>
Returns the unobscured area of the display where interactive controls should be rendered. See also [method get_display_cutouts].
</description>
</method>
<method name="get_name" qualifiers="const">
<return type="String" />
<description>
</description>
</method>
<method name="get_screen_count" qualifiers="const">
<return type="int" />
<description>
</description>
</method>
<method name="get_swap_cancel_ok">
<return type="bool" />
<description>
</description>
</method>
<method name="get_window_at_screen_position" qualifiers="const">
<return type="int" />
<argument index="0" name="position" type="Vector2i" />
<description>
</description>
</method>
<method name="get_window_list" qualifiers="const">
<return type="PackedInt32Array" />
<description>
</description>
</method>
<method name="global_menu_add_check_item">
<return type="void" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="label" type="String" />
<argument index="2" name="callback" type="Callable" />
<argument index="3" name="tag" type="Variant" default="null" />
<argument index="4" name="accelerator" type="int" enum="Key" default="0" />
<argument index="5" name="index" type="int" default="-1" />
<description>
Adds a new checkable item with text [code]label[/code] to the global menu with ID [code]menu_root[/code].
[b]Note:[/b] This method is implemented on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
"" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
[/codeblock]
</description>
</method>
<method name="global_menu_add_icon_check_item">
<return type="void" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="icon" type="Texture2D" />
<argument index="2" name="label" type="String" />
<argument index="3" name="callback" type="Callable" />
<argument index="4" name="tag" type="Variant" default="null" />
<argument index="5" name="accelerator" type="int" enum="Key" default="0" />
<argument index="6" name="index" type="int" default="-1" />
<description>
Adds a new checkable item with text [code]label[/code] and icon [code]icon[/code] to the global menu with ID [code]menu_root[/code].
[b]Note:[/b] This method is implemented on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
"" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
[/codeblock]
</description>
</method>
<method name="global_menu_add_icon_item">
<return type="void" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="icon" type="Texture2D" />
<argument index="2" name="label" type="String" />
<argument index="3" name="callback" type="Callable" />
<argument index="4" name="tag" type="Variant" default="null" />
<argument index="5" name="accelerator" type="int" enum="Key" default="0" />
<argument index="6" name="index" type="int" default="-1" />
<description>
Adds a new item with text [code]label[/code] and icon [code]icon[/code] to the global menu with ID [code]menu_root[/code].
[b]Note:[/b] This method is implemented on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
"" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
[/codeblock]
</description>
</method>
<method name="global_menu_add_icon_radio_check_item">
<return type="void" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="icon" type="Texture2D" />
<argument index="2" name="label" type="String" />
<argument index="3" name="callback" type="Callable" />
<argument index="4" name="tag" type="Variant" default="null" />
<argument index="5" name="accelerator" type="int" enum="Key" default="0" />
<argument index="6" name="index" type="int" default="-1" />
<description>
Adds a new radio-checkable item with text [code]label[/code] and icon [code]icon[/code] to the global menu with ID [code]menu_root[/code].
[b]Note:[/b] Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method global_menu_set_item_checked] for more info on how to control it.
[b]Note:[/b] This method is implemented on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
"" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
[/codeblock]
</description>
</method>
<method name="global_menu_add_item">
<return type="void" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="label" type="String" />
<argument index="2" name="callback" type="Callable" />
<argument index="3" name="tag" type="Variant" default="null" />
<argument index="4" name="accelerator" type="int" enum="Key" default="0" />
<argument index="5" name="index" type="int" default="-1" />
<description>
Adds a new item with text [code]label[/code] to the global menu with ID [code]menu_root[/code].
[b]Note:[/b] This method is implemented on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
"" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
[/codeblock]
</description>
</method>
<method name="global_menu_add_multistate_item">
<return type="void" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="labe" type="String" />
<argument index="2" name="max_states" type="int" />
<argument index="3" name="default_state" type="int" />
<argument index="4" name="callback" type="Callable" />
<argument index="5" name="tag" type="Variant" default="null" />
<argument index="6" name="accelerator" type="int" enum="Key" default="0" />
<argument index="7" name="index" type="int" default="-1" />
<description>
Adds a new item with text [code]label[/code] to the global menu with ID [code]menu_root[/code].
Contrarily to normal binary items, multistate items can have more than two states, as defined by [code]max_states[/code]. Each press or activate of the item will increase the state by one. The default value is defined by [code]default_state[/code].
[b]Note:[/b] This method is implemented on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
"" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
[/codeblock]
</description>
</method>
<method name="global_menu_add_radio_check_item">
<return type="void" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="label" type="String" />
<argument index="2" name="callback" type="Callable" />
<argument index="3" name="tag" type="Variant" default="null" />
<argument index="4" name="accelerator" type="int" enum="Key" default="0" />
<argument index="5" name="index" type="int" default="-1" />
<description>
Adds a new radio-checkable item with text [code]label[/code] to the global menu with ID [code]menu_root[/code].
[b]Note:[/b] Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method global_menu_set_item_checked] for more info on how to control it.
[b]Note:[/b] This method is implemented on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
"" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
[/codeblock]
</description>
</method>
<method name="global_menu_add_separator">
<return type="void" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="index" type="int" default="-1" />
<description>
Adds a separator between items to the global menu with ID [code]menu_root[/code]. Separators also occupy an index.
[b]Note:[/b] This method is implemented on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
"" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
[/codeblock]
</description>
</method>
<method name="global_menu_add_submenu_item">
<return type="void" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="label" type="String" />
<argument index="2" name="submenu" type="String" />
<argument index="3" name="index" type="int" default="-1" />
<description>
Adds an item that will act as a submenu of the global menu [code]menu_root[/code]. The [code]submenu[/code] argument is the ID of the global menu root that will be shown when the item is clicked.
[b]Note:[/b] This method is implemented on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
"" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
[/codeblock]
</description>
</method>
<method name="global_menu_clear">
<return type="void" />
<argument index="0" name="menu_root" type="String" />
<description>
Removes all items from the global menu with ID [code]menu_root[/code].
[b]Note:[/b] This method is implemented on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
"" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
[/codeblock]
</description>
</method>
<method name="global_menu_get_item_accelerator" qualifiers="const">
<return type="int" enum="Key" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<description>
Returns the accelerator of the item at index [code]idx[/code]. Accelerators are special combinations of keys that activate the item, no matter which control is focused.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_get_item_callback" qualifiers="const">
<return type="Callable" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<description>
Returns the callback of the item at index [code]idx[/code].
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_get_item_icon" qualifiers="const">
<return type="Texture2D" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<description>
Returns the icon of the item at index [code]idx[/code].
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_get_item_index_from_tag" qualifiers="const">
<return type="int" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="tag" type="Variant" />
<description>
Returns the index of the item with the specified [code]tag[/code]. Index is automatically assigned to each item by the engine. Index can not be set manually.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_get_item_index_from_text" qualifiers="const">
<return type="int" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="text" type="String" />
<description>
Returns the index of the item with the specified [code]text[/code]. Index is automatically assigned to each item by the engine. Index can not be set manually.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_get_item_max_states" qualifiers="const">
<return type="int" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<description>
Returns number of states of an multistate item. See [method global_menu_add_multistate_item] for details.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_get_item_state" qualifiers="const">
<return type="int" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<description>
Returns the state of an multistate item. See [method global_menu_add_multistate_item] for details.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_get_item_submenu" qualifiers="const">
<return type="String" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<description>
Returns the submenu ID of the item at index [code]idx[/code]. See [method global_menu_add_submenu_item] for more info on how to add a submenu.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_get_item_tag" qualifiers="const">
<return type="Variant" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<description>
Returns the metadata of the specified item, which might be of any type. You can set it with [method global_menu_set_item_tag], which provides a simple way of assigning context data to items.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_get_item_text" qualifiers="const">
<return type="String" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<description>
Returns the text of the item at index [code]idx[/code].
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_get_item_tooltip" qualifiers="const">
<return type="String" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<description>
Returns the tooltip associated with the specified index index [code]idx[/code].
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_is_item_checkable" qualifiers="const">
<return type="bool" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<description>
Returns [code]true[/code] if the item at index [code]idx[/code] is checkable in some way, i.e. if it has a checkbox or radio button.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_is_item_checked" qualifiers="const">
<return type="bool" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<description>
Returns [code]true[/code] if the item at index [code]idx[/code] is checked.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_is_item_disabled" qualifiers="const">
<return type="bool" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<description>
Returns [code]true[/code] if the item at index [code]idx[/code] is disabled. When it is disabled it can't be selected, or its action invoked.
See [method global_menu_set_item_disabled] for more info on how to disable an item.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_is_item_radio_checkable" qualifiers="const">
<return type="bool" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<description>
Returns [code]true[/code] if the item at index [code]idx[/code] has radio button-style checkability.
[b]Note:[/b] This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_remove_item">
<return type="void" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<description>
Removes the item at index [code]idx[/code] from the global menu [code]menu_root[/code].
[b]Note:[/b] The indices of items after the removed item will be shifted by one.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_set_item_accelerator">
<return type="void" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<argument index="2" name="keycode" type="int" enum="Key" />
<description>
Sets the accelerator of the item at index [code]idx[/code].
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_set_item_callback">
<return type="void" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<argument index="2" name="callback" type="Callable" />
<description>
Sets the callback of the item at index [code]idx[/code]. Callback is emitted when an item is pressed or its accelerator is activated.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_set_item_checkable">
<return type="void" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<argument index="2" name="checkable" type="bool" />
<description>
Sets whether the item at index [code]idx[/code] has a checkbox. If [code]false[/code], sets the type of the item to plain text.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_set_item_checked">
<return type="void" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<argument index="2" name="checked" type="bool" />
<description>
Sets the checkstate status of the item at index [code]idx[/code].
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_set_item_disabled">
<return type="void" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<argument index="2" name="disabled" type="bool" />
<description>
Enables/disables the item at index [code]idx[/code]. When it is disabled, it can't be selected and its action can't be invoked.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_set_item_icon">
<return type="void" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<argument index="2" name="icon" type="Texture2D" />
<description>
Replaces the [Texture2D] icon of the specified [code]idx[/code].
[b]Note:[/b] This method is implemented on macOS.
[b]Note:[/b] This method is not supported by macOS "_dock" menu items.
</description>
</method>
<method name="global_menu_set_item_max_states">
<return type="void" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<argument index="2" name="max_states" type="int" />
<description>
Sets number of state of an multistate item. See [method global_menu_add_multistate_item] for details.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_set_item_radio_checkable">
<return type="void" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<argument index="2" name="checkable" type="bool" />
<description>
Sets the type of the item at the specified index [code]idx[/code] to radio button. If [code]false[/code], sets the type of the item to plain text
[b]Note:[/b] This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_set_item_state">
<return type="void" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<argument index="2" name="state" type="int" />
<description>
Sets the state of an multistate item. See [method global_menu_add_multistate_item] for details.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_set_item_submenu">
<return type="void" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<argument index="2" name="submenu" type="String" />
<description>
Sets the submenu of the item at index [code]idx[/code]. The submenu is the ID of a global menu root that would be shown when the item is clicked.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_set_item_tag">
<return type="void" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<argument index="2" name="tag" type="Variant" />
<description>
Sets the metadata of an item, which may be of any type. You can later get it with [method global_menu_get_item_tag], which provides a simple way of assigning context data to items.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_set_item_text">
<return type="void" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<argument index="2" name="text" type="String" />
<description>
Sets the text of the item at index [code]idx[/code].
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_set_item_tooltip">
<return type="void" />
<argument index="0" name="menu_root" type="String" />
<argument index="1" name="idx" type="int" />
<argument index="2" name="tooltip" type="String" />
<description>
Sets the [String] tooltip of the item at the specified index [code]idx[/code].
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="has_feature" qualifiers="const">
<return type="bool" />
<argument index="0" name="feature" type="int" enum="DisplayServer.Feature" />
<description>
</description>
</method>
<method name="ime_get_selection" qualifiers="const">
<return type="Vector2i" />
<description>
</description>
</method>
<method name="ime_get_text" qualifiers="const">
<return type="String" />
<description>
</description>
</method>
<method name="keyboard_get_current_layout" qualifiers="const">
<return type="int" />
<description>
Returns active keyboard layout index.
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<method name="keyboard_get_keycode_from_physical" qualifiers="const">
<return type="int" enum="Key" />
<argument index="0" name="keycode" type="int" enum="Key" />
<description>
Converts a physical (US QWERTY) [code]keycode[/code] to one in the active keyboard layout.
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<method name="keyboard_get_layout_count" qualifiers="const">
<return type="int" />
<description>
Returns the number of keyboard layouts.
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<method name="keyboard_get_layout_language" qualifiers="const">
<return type="String" />
<argument index="0" name="index" type="int" />
<description>
Returns the ISO-639/BCP-47 language code of the keyboard layout at position [code]index[/code].
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<method name="keyboard_get_layout_name" qualifiers="const">
<return type="String" />
<argument index="0" name="index" type="int" />
<description>
Returns the localized name of the keyboard layout at position [code]index[/code].
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<method name="keyboard_set_current_layout">
<return type="void" />
<argument index="0" name="index" type="int" />
<description>
Sets active keyboard layout.
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<method name="mouse_get_button_state" qualifiers="const">
<return type="int" enum="MouseButton" />
<description>
</description>
</method>
<method name="mouse_get_mode" qualifiers="const">
<return type="int" enum="DisplayServer.MouseMode" />
<description>
</description>
</method>
<method name="mouse_get_position" qualifiers="const">
<return type="Vector2i" />
<description>
Returns the mouse cursor's current position.
</description>
</method>
<method name="mouse_set_mode">
<return type="void" />
<argument index="0" name="mouse_mode" type="int" enum="DisplayServer.MouseMode" />
<description>
</description>
</method>
<method name="process_events">
<return type="void" />
<description>
</description>
</method>
<method name="screen_get_dpi" qualifiers="const">
<return type="int" />
<argument index="0" name="screen" type="int" default="-1" />
<description>
Returns the dots per inch density of the specified screen. If [code]screen[/code] is [/code]SCREEN_OF_MAIN_WINDOW[/code] (the default value), a screen with the main window will be used.
[b]Note:[/b] On macOS, returned value is inaccurate if fractional display scaling mode is used.
[b]Note:[/b] On Android devices, the actual screen densities are grouped into six generalized densities:
[codeblock]
ldpi - 120 dpi
mdpi - 160 dpi
hdpi - 240 dpi
xhdpi - 320 dpi
xxhdpi - 480 dpi
xxxhdpi - 640 dpi
[/codeblock]
[b]Note:[/b] This method is implemented on Android, Linux, macOS and Windows. Returns [code]72[/code] on unsupported platforms.
</description>
</method>
<method name="screen_get_max_scale" qualifiers="const">
<return type="float" />
<description>
Returns the greatest scale factor of all screens.
[b]Note:[/b] On macOS returned value is [code]2.0[/code] if there is at least one hiDPI (Retina) screen in the system, and [code]1.0[/code] in all other cases.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="screen_get_orientation" qualifiers="const">
<return type="int" enum="DisplayServer.ScreenOrientation" />
<argument index="0" name="screen" type="int" default="-1" />
<description>
</description>
</method>
<method name="screen_get_position" qualifiers="const">
<return type="Vector2i" />
<argument index="0" name="screen" type="int" default="-1" />
<description>
</description>
</method>
<method name="screen_get_refresh_rate" qualifiers="const">
<return type="float" />
<argument index="0" name="screen" type="int" default="-1" />
<description>
Returns the current refresh rate of the specified screen. If [code]screen[/code] is [constant SCREEN_OF_MAIN_WINDOW] (the default value), a screen with the main window will be used.
[b]Note:[/b] Returns [code]-1.0[/code] if the DisplayServer fails to find the refresh rate for the specified screen. On HTML5, [method screen_get_refresh_rate] will always return [code]-1.0[/code] as there is no way to retrieve the refresh rate on that platform.
To fallback to a default refresh rate if the method fails, try:
[codeblock]
var refresh_rate = DisplayServer.screen_get_refresh_rate()
if refresh_rate < 0:
refresh_rate = 60.0
[/codeblock]
</description>
</method>
<method name="screen_get_scale" qualifiers="const">
<return type="float" />
<argument index="0" name="screen" type="int" default="-1" />
<description>
Returns the scale factor of the specified screen by index.
[b]Note:[/b] On macOS returned value is [code]2.0[/code] for hiDPI (Retina) screen, and [code]1.0[/code] for all other cases.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="screen_get_size" qualifiers="const">
<return type="Vector2i" />
<argument index="0" name="screen" type="int" default="-1" />
<description>
</description>
</method>
<method name="screen_get_usable_rect" qualifiers="const">
<return type="Rect2i" />
<argument index="0" name="screen" type="int" default="-1" />
<description>
</description>
</method>
<method name="screen_is_kept_on" qualifiers="const">
<return type="bool" />
<description>
</description>
</method>
<method name="screen_is_touchscreen" qualifiers="const">
<return type="bool" />
<argument index="0" name="screen" type="int" default="-1" />
<description>
</description>
</method>
<method name="screen_set_keep_on">
<return type="void" />
<argument index="0" name="enable" type="bool" />
<description>
</description>
</method>
<method name="screen_set_orientation">
<return type="void" />
<argument index="0" name="orientation" type="int" enum="DisplayServer.ScreenOrientation" />
<argument index="1" name="screen" type="int" default="-1" />
<description>
</description>
</method>
<method name="set_icon">
<return type="void" />
<argument index="0" name="image" type="Image" />
<description>
</description>
</method>
<method name="set_native_icon">
<return type="void" />
<argument index="0" name="filename" type="String" />
<description>
</description>
</method>
<method name="tablet_get_current_driver" qualifiers="const">
<return type="String" />
<description>
Returns current active tablet driver name.
[b]Note:[/b] This method is implemented on Windows.
</description>
</method>
<method name="tablet_get_driver_count" qualifiers="const">
<return type="int" />
<description>
Returns the total number of available tablet drivers.
[b]Note:[/b] This method is implemented on Windows.
</description>
</method>
<method name="tablet_get_driver_name" qualifiers="const">
<return type="String" />
<argument index="0" name="idx" type="int" />
<description>
Returns the tablet driver name for the given index.
[b]Note:[/b] This method is implemented on Windows.
</description>
</method>
<method name="tablet_set_current_driver">
<return type="void" />
<argument index="0" name="name" type="String" />
<description>
Set active tablet driver name.
[b]Note:[/b] This method is implemented on Windows.
</description>
</method>
<method name="tts_get_voices" qualifiers="const">
<return type="Array" />
<description>
Returns an [Array] of voice information dictionaries.
Each [Dictionary] contains two [String] entries:
- [code]name[/code] is voice name.
- [code]id[/code] is voice identifier.
- [code]language[/code] is language code in [code]lang_Variant[/code] format. [code]lang[/code] part is a 2 or 3-letter code based on the ISO-639 standard, in lowercase. And [code]Variant[/code] part is an engine dependent string describing country, region or/and dialect.
[b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows.
</description>
</method>
<method name="tts_get_voices_for_language" qualifiers="const">
<return type="PackedStringArray" />
<argument index="0" name="language" type="String" />
<description>
Returns an [PackedStringArray] of voice identifiers for the [code]language[/code].
[b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows.
</description>
</method>
<method name="tts_is_paused" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if the synthesizer is in a paused state.
[b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows.
</description>
</method>
<method name="tts_is_speaking" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if the synthesizer is generating speech, or have utterance waiting in the queue.
[b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows.
</description>
</method>
<method name="tts_pause">
<return type="void" />
<description>
Puts the synthesizer into a paused state.
[b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows.
</description>
</method>
<method name="tts_resume">
<return type="void" />
<description>
Resumes the synthesizer if it was paused.
[b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows.
</description>
</method>
<method name="tts_set_utterance_callback">
<return type="void" />
<argument index="0" name="event" type="int" enum="DisplayServer.TTSUtteranceEvent" />
<argument index="1" name="callable" type="Callable" />
<description>
Adds a callback, which is called when the utterance has started, finished, canceled or reached a text boundary.
- [code]TTS_UTTERANCE_STARTED[/code], [code]TTS_UTTERANCE_ENDED[/code], and [code]TTS_UTTERANCE_CANCELED[/code] callable's method should take one [int] parameter, the utterance id.
- [code]TTS_UTTERANCE_BOUNDARY[/code] callable's method should take two [int] parameters, the index of the character and the utterance id.
[b]Note:[/b] The granularity of the boundary callbacks is engine dependent.
[b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows.
</description>
</method>
<method name="tts_speak">
<return type="void" />
<argument index="0" name="text" type="String" />
<argument index="1" name="voice" type="String" />
<argument index="2" name="volume" type="int" default="50" />
<argument index="3" name="pitch" type="float" default="1.0" />
<argument index="4" name="rate" type="float" default="1.0" />
<argument index="5" name="utterance_id" type="int" default="0" />
<argument index="6" name="interrupt" type="bool" default="false" />
<description>
Adds an utterance to the queue. If [code]interrupt[/code] is [code]true[/code], the queue is cleared first.
- [code]voice[/code] identifier is one of the [code]"id"[/code] values returned by [method tts_get_voices] or one of the values returned by [method tts_get_voices_for_language].
- [code]volume[/code] ranges from [code]0[/code] (lowest) to [code]100[/code] (highest).
- [code]pitch[/code] ranges from [code]0.0[/code] (lowest) to [code]2.0[/code] (highest), [code]1.0[/code] is default pitch for the current voice.
- [code]rate[/code] ranges from [code]0.1[/code] (lowest) to [code]10.0[/code] (highest), [code]1.0[/code] is a normal speaking rate. Other values act as a percentage relative.
- [code]utterance_id[/code] is passed as a parameter to the callback functions.
[b]Note:[/b] On Windows and Linux, utterance [code]text[/code] can use SSML markup. SSML support is engine and voice dependent. If the engine does not support SSML, you should strip out all XML markup before calling [method tts_speak].
[b]Note:[/b] The granularity of pitch, rate, and volume is engine and voice dependent. Values may be truncated.
[b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows.
</description>
</method>
<method name="tts_stop">
<return type="void" />
<description>
Stops synthesis in progress and removes all utterances from the queue.
[b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows.
</description>
</method>
<method name="virtual_keyboard_get_height" qualifiers="const">
<return type="int" />
<description>
Returns the on-screen keyboard's height in pixels. Returns 0 if there is no keyboard or if it is currently hidden.
</description>
</method>
<method name="virtual_keyboard_hide">
<return type="void" />
<description>
Hides the virtual keyboard if it is shown, does nothing otherwise.
</description>
</method>
<method name="virtual_keyboard_show">
<return type="void" />
<argument index="0" name="existing_text" type="String" />
<argument index="1" name="position" type="Rect2" default="Rect2(0, 0, 0, 0)" />
<argument index="2" name="multiline" type="bool" default="false" />
<argument index="3" name="max_length" type="int" default="-1" />
<argument index="4" name="cursor_start" type="int" default="-1" />
<argument index="5" name="cursor_end" type="int" default="-1" />
<description>
Shows the virtual keyboard if the platform has one.
[code]existing_text[/code] parameter is useful for implementing your own [LineEdit] or [TextEdit], as it tells the virtual keyboard what text has already been typed (the virtual keyboard uses it for auto-correct and predictions).
[code]position[/code] parameter is the screen space [Rect2] of the edited text.
[code]multiline[/code] parameter needs to be set to [code]true[/code] to be able to enter multiple lines of text, as in [TextEdit].
[code]max_length[/code] limits the number of characters that can be entered if different from [code]-1[/code].
[code]cursor_start[/code] can optionally define the current text cursor position if [code]cursor_end[/code] is not set.
[code]cursor_start[/code] and [code]cursor_end[/code] can optionally define the current text selection.
[b]Note:[/b] This method is implemented on Android, iOS and UWP.
</description>
</method>
<method name="warp_mouse">
<return type="void" />
<argument index="0" name="position" type="Vector2i" />
<description>
Sets the mouse cursor position to the given [code]position[/code] relative to an origin at the upper left corner of the currently focused game Window Manager window.
</description>
</method>
<method name="window_attach_instance_id">
<return type="void" />
<argument index="0" name="instance_id" type="int" />
<argument index="1" name="window_id" type="int" default="0" />
<description>
</description>
</method>
<method name="window_can_draw" qualifiers="const">
<return type="bool" />
<argument index="0" name="window_id" type="int" default="0" />
<description>
</description>
</method>
<method name="window_get_active_popup" qualifiers="const">
<return type="int" />
<description>
Returns ID of the active popup window, or [constant INVALID_WINDOW_ID] if there is none.
</description>
</method>
<method name="window_get_attached_instance_id" qualifiers="const">
<return type="int" />
<argument index="0" name="window_id" type="int" default="0" />
<description>
</description>
</method>
<method name="window_get_current_screen" qualifiers="const">
<return type="int" />
<argument index="0" name="window_id" type="int" default="0" />
<description>
</description>
</method>
<method name="window_get_flag" qualifiers="const">
<return type="bool" />
<argument index="0" name="flag" type="int" enum="DisplayServer.WindowFlags" />
<argument index="1" name="window_id" type="int" default="0" />
<description>
Returns the current value of the given window's [code]flag[/code].
</description>
</method>
<method name="window_get_max_size" qualifiers="const">
<return type="Vector2i" />
<argument index="0" name="window_id" type="int" default="0" />
<description>
</description>
</method>
<method name="window_get_min_size" qualifiers="const">
<return type="Vector2i" />
<argument index="0" name="window_id" type="int" default="0" />
<description>
</description>
</method>
<method name="window_get_mode" qualifiers="const">
<return type="int" enum="DisplayServer.WindowMode" />
<argument index="0" name="window_id" type="int" default="0" />
<description>
Returns the mode of the given window.
</description>
</method>
<method name="window_get_native_handle" qualifiers="const">
<return type="int" />
<argument index="0" name="handle_type" type="int" enum="DisplayServer.HandleType" />
<argument index="1" name="window_id" type="int" default="0" />
<description>
Returns internal structure pointers for use in plugins.
[b]Note:[/b] This method is implemented on Android, Linux, macOS and Windows.
</description>
</method>
<method name="window_get_popup_safe_rect" qualifiers="const">
<return type="Rect2i" />
<argument index="0" name="window" type="int" />
<description>
Returns the bounding box of control, or menu item that was used to open the popup window, in the screen coordinate system.
</description>
</method>
<method name="window_get_position" qualifiers="const">
<return type="Vector2i" />
<argument index="0" name="window_id" type="int" default="0" />
<description>
Returns the position of the given window to on the screen.
</description>
</method>
<method name="window_get_real_size" qualifiers="const">
<return type="Vector2i" />
<argument index="0" name="window_id" type="int" default="0" />
<description>
</description>
</method>
<method name="window_get_size" qualifiers="const">
<return type="Vector2i" />
<argument index="0" name="window_id" type="int" default="0" />
<description>
</description>
</method>
<method name="window_get_vsync_mode" qualifiers="const">
<return type="int" enum="DisplayServer.VSyncMode" />
<argument index="0" name="window_id" type="int" default="0" />
<description>
Returns the VSync mode of the given window.
</description>
</method>
<method name="window_move_to_foreground">
<return type="void" />
<argument index="0" name="window_id" type="int" default="0" />
<description>
</description>
</method>
<method name="window_request_attention">
<return type="void" />
<argument index="0" name="window_id" type="int" default="0" />
<description>
</description>
</method>
<method name="window_set_current_screen">
<return type="void" />
<argument index="0" name="screen" type="int" />
<argument index="1" name="window_id" type="int" default="0" />
<description>
</description>
</method>
<method name="window_set_drop_files_callback">
<return type="void" />
<argument index="0" name="callback" type="Callable" />
<argument index="1" name="window_id" type="int" default="0" />
<description>
</description>
</method>
<method name="window_set_exclusive">
<return type="void" />
<argument index="0" name="window_id" type="int" />
<argument index="1" name="exclusive" type="bool" />
<description>
If set to [code]true[/code], this window will always stay on top of its parent window, parent window will ignore input while this window is opened.
[b]Note:[/b] On macOS, exclusive windows are confined to the same space (virtual desktop or screen) as the parent window.
[b]Note:[/b] This method is implemented on macOS and Windows.
</description>
</method>
<method name="window_set_flag">
<return type="void" />
<argument index="0" name="flag" type="int" enum="DisplayServer.WindowFlags" />
<argument index="1" name="enabled" type="bool" />
<argument index="2" name="window_id" type="int" default="0" />
<description>
Enables or disables the given window's given [code]flag[/code]. See [enum WindowFlags] for possible values and their behavior.
</description>
</method>
<method name="window_set_ime_active">
<return type="void" />
<argument index="0" name="active" type="bool" />
<argument index="1" name="window_id" type="int" default="0" />
<description>
</description>
</method>
<method name="window_set_ime_position">
<return type="void" />
<argument index="0" name="position" type="Vector2i" />
<argument index="1" name="window_id" type="int" default="0" />
<description>
</description>
</method>
<method name="window_set_input_event_callback">
<return type="void" />
<argument index="0" name="callback" type="Callable" />
<argument index="1" name="window_id" type="int" default="0" />
<description>
</description>
</method>
<method name="window_set_input_text_callback">
<return type="void" />
<argument index="0" name="callback" type="Callable" />
<argument index="1" name="window_id" type="int" default="0" />
<description>
</description>
</method>
<method name="window_set_max_size">
<return type="void" />
<argument index="0" name="max_size" type="Vector2i" />
<argument index="1" name="window_id" type="int" default="0" />
<description>
</description>
</method>
<method name="window_set_min_size">
<return type="void" />
<argument index="0" name="min_size" type="Vector2i" />
<argument index="1" name="window_id" type="int" default="0" />
<description>
Sets the minimum size for the given window to [code]min_size[/code] (in pixels).
[b]Note:[/b] By default, the main window has a minimum size of [code]Vector2i(64, 64)[/code]. This prevents issues that can arise when the window is resized to a near-zero size.
</description>
</method>
<method name="window_set_mode">
<return type="void" />
<argument index="0" name="mode" type="int" enum="DisplayServer.WindowMode" />
<argument index="1" name="window_id" type="int" default="0" />
<description>
Sets window mode for the given window to [code]mode[/code]. See [enum WindowMode] for possible values and how each mode behaves.
[b]Note:[/b] Setting the window to fullscreen forcibly sets the borderless flag to [code]true[/code], so make sure to set it back to [code]false[/code] when not wanted.
</description>
</method>
<method name="window_set_mouse_passthrough">
<return type="void" />
<argument index="0" name="region" type="PackedVector2Array" />
<argument index="1" name="window_id" type="int" default="0" />
<description>
Sets a polygonal region of the window which accepts mouse events. Mouse events outside the region will be passed through.
Passing an empty array will disable passthrough support (all mouse events will be intercepted by the window, which is the default behavior).
[codeblocks]
[gdscript]
# Set region, using Path2D node.
DisplayServer.window_set_mouse_passthrough($Path2D.curve.get_baked_points())
# Set region, using Polygon2D node.
DisplayServer.window_set_mouse_passthrough($Polygon2D.polygon)
# Reset region to default.
DisplayServer.window_set_mouse_passthrough([])
[/gdscript]
[csharp]
// Set region, using Path2D node.
DisplayServer.WindowSetMousePassthrough(GetNode<Path2D>("Path2D").Curve.GetBakedPoints());
// Set region, using Polygon2D node.
DisplayServer.WindowSetMousePassthrough(GetNode<Polygon2D>("Polygon2D").Polygon);
// Reset region to default.
DisplayServer.WindowSetMousePassthrough(new Vector2[] {});
[/csharp]
[/codeblocks]
[b]Note:[/b] On Windows, the portion of a window that lies outside the region is not drawn, while on Linux and macOS it is.
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<method name="window_set_popup_safe_rect">
<return type="void" />
<argument index="0" name="window" type="int" />
<argument index="1" name="rect" type="Rect2i" />
<description>
Sets the bounding box of control, or menu item that was used to open the popup window, in the screen coordinate system. Clicking this area will not auto-close this popup.
</description>
</method>
<method name="window_set_position">
<return type="void" />
<argument index="0" name="position" type="Vector2i" />
<argument index="1" name="window_id" type="int" default="0" />
<description>
Sets the position of the given window to [code]position[/code].
</description>
</method>
<method name="window_set_rect_changed_callback">
<return type="void" />
<argument index="0" name="callback" type="Callable" />
<argument index="1" name="window_id" type="int" default="0" />
<description>
</description>
</method>
<method name="window_set_size">
<return type="void" />
<argument index="0" name="size" type="Vector2i" />
<argument index="1" name="window_id" type="int" default="0" />
<description>
Sets the size of the given window to [code]size[/code].
</description>
</method>
<method name="window_set_title">
<return type="void" />
<argument index="0" name="title" type="String" />
<argument index="1" name="window_id" type="int" default="0" />
<description>
Sets the title of the given window to [code]title[/code].
</description>
</method>
<method name="window_set_transient">
<return type="void" />
<argument index="0" name="window_id" type="int" />
<argument index="1" name="parent_window_id" type="int" />
<description>
</description>
</method>
<method name="window_set_vsync_mode">
<return type="void" />
<argument index="0" name="vsync_mode" type="int" enum="DisplayServer.VSyncMode" />
<argument index="1" name="window_id" type="int" default="0" />
<description>
Sets the VSync mode of the given window.
See [enum DisplayServer.VSyncMode] for possible values and how they affect the behavior of your application.
Depending on the platform and used renderer, the engine will fall back to [constant VSYNC_ENABLED], if the desired mode is not supported.
</description>
</method>
<method name="window_set_window_event_callback">
<return type="void" />
<argument index="0" name="callback" type="Callable" />
<argument index="1" name="window_id" type="int" default="0" />
<description>
</description>
</method>
</methods>
<constants>
<constant name="FEATURE_GLOBAL_MENU" value="0" enum="Feature">
</constant>
<constant name="FEATURE_SUBWINDOWS" value="1" enum="Feature">
</constant>
<constant name="FEATURE_TOUCHSCREEN" value="2" enum="Feature">
</constant>
<constant name="FEATURE_MOUSE" value="3" enum="Feature">
</constant>
<constant name="FEATURE_MOUSE_WARP" value="4" enum="Feature">
</constant>
<constant name="FEATURE_CLIPBOARD" value="5" enum="Feature">
</constant>
<constant name="FEATURE_VIRTUAL_KEYBOARD" value="6" enum="Feature">
</constant>
<constant name="FEATURE_CURSOR_SHAPE" value="7" enum="Feature">
</constant>
<constant name="FEATURE_CUSTOM_CURSOR_SHAPE" value="8" enum="Feature">
</constant>
<constant name="FEATURE_NATIVE_DIALOG" value="9" enum="Feature">
</constant>
<constant name="FEATURE_IME" value="10" enum="Feature">
</constant>
<constant name="FEATURE_WINDOW_TRANSPARENCY" value="11" enum="Feature">
</constant>
<constant name="FEATURE_HIDPI" value="12" enum="Feature">
</constant>
<constant name="FEATURE_ICON" value="13" enum="Feature">
</constant>
<constant name="FEATURE_NATIVE_ICON" value="14" enum="Feature">
</constant>
<constant name="FEATURE_ORIENTATION" value="15" enum="Feature">
</constant>
<constant name="FEATURE_SWAP_BUFFERS" value="16" enum="Feature">
</constant>
<constant name="FEATURE_CLIPBOARD_PRIMARY" value="18" enum="Feature">
</constant>
<constant name="FEATURE_TEXT_TO_SPEECH" value="19" enum="Feature">
Display server supports text-to-speech. See [code]tts_*[/code] methods.
</constant>
<constant name="MOUSE_MODE_VISIBLE" value="0" enum="MouseMode">
Makes the mouse cursor visible if it is hidden.
</constant>
<constant name="MOUSE_MODE_HIDDEN" value="1" enum="MouseMode">
Makes the mouse cursor hidden if it is visible.
</constant>
<constant name="MOUSE_MODE_CAPTURED" value="2" enum="MouseMode">
Captures the mouse. The mouse will be hidden and its position locked at the center of the screen.
[b]Note:[/b] If you want to process the mouse's movement in this mode, you need to use [member InputEventMouseMotion.relative].
</constant>
<constant name="MOUSE_MODE_CONFINED" value="3" enum="MouseMode">
Confines the mouse cursor to the game window, and make it visible.
</constant>
<constant name="MOUSE_MODE_CONFINED_HIDDEN" value="4" enum="MouseMode">
Confines the mouse cursor to the game window, and make it hidden.
</constant>
<constant name="SCREEN_OF_MAIN_WINDOW" value="-1">
</constant>
<constant name="MAIN_WINDOW_ID" value="0">
</constant>
<constant name="INVALID_WINDOW_ID" value="-1">
</constant>
<constant name="SCREEN_LANDSCAPE" value="0" enum="ScreenOrientation">
</constant>
<constant name="SCREEN_PORTRAIT" value="1" enum="ScreenOrientation">
</constant>
<constant name="SCREEN_REVERSE_LANDSCAPE" value="2" enum="ScreenOrientation">
</constant>
<constant name="SCREEN_REVERSE_PORTRAIT" value="3" enum="ScreenOrientation">
</constant>
<constant name="SCREEN_SENSOR_LANDSCAPE" value="4" enum="ScreenOrientation">
</constant>
<constant name="SCREEN_SENSOR_PORTRAIT" value="5" enum="ScreenOrientation">
</constant>
<constant name="SCREEN_SENSOR" value="6" enum="ScreenOrientation">
</constant>
<constant name="CURSOR_ARROW" value="0" enum="CursorShape">
</constant>
<constant name="CURSOR_IBEAM" value="1" enum="CursorShape">
</constant>
<constant name="CURSOR_POINTING_HAND" value="2" enum="CursorShape">
</constant>
<constant name="CURSOR_CROSS" value="3" enum="CursorShape">
</constant>
<constant name="CURSOR_WAIT" value="4" enum="CursorShape">
</constant>
<constant name="CURSOR_BUSY" value="5" enum="CursorShape">
</constant>
<constant name="CURSOR_DRAG" value="6" enum="CursorShape">
</constant>
<constant name="CURSOR_CAN_DROP" value="7" enum="CursorShape">
</constant>
<constant name="CURSOR_FORBIDDEN" value="8" enum="CursorShape">
</constant>
<constant name="CURSOR_VSIZE" value="9" enum="CursorShape">
</constant>
<constant name="CURSOR_HSIZE" value="10" enum="CursorShape">
</constant>
<constant name="CURSOR_BDIAGSIZE" value="11" enum="CursorShape">
</constant>
<constant name="CURSOR_FDIAGSIZE" value="12" enum="CursorShape">
</constant>
<constant name="CURSOR_MOVE" value="13" enum="CursorShape">
</constant>
<constant name="CURSOR_VSPLIT" value="14" enum="CursorShape">
</constant>
<constant name="CURSOR_HSPLIT" value="15" enum="CursorShape">
</constant>
<constant name="CURSOR_HELP" value="16" enum="CursorShape">
</constant>
<constant name="CURSOR_MAX" value="17" enum="CursorShape">
</constant>
<constant name="WINDOW_MODE_WINDOWED" value="0" enum="WindowMode">
</constant>
<constant name="WINDOW_MODE_MINIMIZED" value="1" enum="WindowMode">
</constant>
<constant name="WINDOW_MODE_MAXIMIZED" value="2" enum="WindowMode">
</constant>
<constant name="WINDOW_MODE_FULLSCREEN" value="3" enum="WindowMode">
Fullscreen window mode. Note that this is not [i]exclusive[/i] fullscreen. On Windows and Linux, a borderless window is used to emulate fullscreen. On macOS, a new desktop is used to display the running project.
Regardless of the platform, enabling fullscreen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=$DOCS_URL/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling fullscreen mode.
</constant>
<constant name="WINDOW_MODE_EXCLUSIVE_FULLSCREEN" value="4" enum="WindowMode">
Exclusive fullscreen window mode. This mode is implemented on Windows only. On other platforms, it is equivalent to [constant WINDOW_MODE_FULLSCREEN].
Only one window in exclusive fullscreen mode can be visible on a given screen at a time. If multiple windows are in exclusive fullscreen mode for the same screen, the last one being set to this mode takes precedence.
Regardless of the platform, enabling fullscreen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=$DOCS_URL/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling fullscreen mode.
</constant>
<constant name="WINDOW_FLAG_RESIZE_DISABLED" value="0" enum="WindowFlags">
Window can't be resizing by dragging its resize grip. It's still possible to resize the window using [method window_set_size]. This flag is ignored for full screen windows.
</constant>
<constant name="WINDOW_FLAG_BORDERLESS" value="1" enum="WindowFlags">
Window do not have native title bar and other decorations. This flag is ignored for full-screen windows.
</constant>
<constant name="WINDOW_FLAG_ALWAYS_ON_TOP" value="2" enum="WindowFlags">
Window is floating above other regular windows. This flag is ignored for full-screen windows.
</constant>
<constant name="WINDOW_FLAG_TRANSPARENT" value="3" enum="WindowFlags">
Window is will be destroyed with its transient parent and displayed on top of non-exclusive full-screen parent window. Transient windows can't enter full-screen mode.
</constant>
<constant name="WINDOW_FLAG_NO_FOCUS" value="4" enum="WindowFlags">
Window can't be focused. No-focus window will ignore all input, except mouse clicks.
</constant>
<constant name="WINDOW_FLAG_POPUP" value="5" enum="WindowFlags">
Window is part of menu or [OptionButton] dropdown. This flag can't be changed when window is visible. An active popup window will exclusively receive all input, without stealing focus from its parent. Popup windows are automatically closed when uses click outside it, or when an application is switched. Popup window must have [constant WINDOW_FLAG_TRANSPARENT] set.
</constant>
<constant name="WINDOW_FLAG_MAX" value="6" enum="WindowFlags">
</constant>
<constant name="WINDOW_EVENT_MOUSE_ENTER" value="0" enum="WindowEvent">
</constant>
<constant name="WINDOW_EVENT_MOUSE_EXIT" value="1" enum="WindowEvent">
</constant>
<constant name="WINDOW_EVENT_FOCUS_IN" value="2" enum="WindowEvent">
</constant>
<constant name="WINDOW_EVENT_FOCUS_OUT" value="3" enum="WindowEvent">
</constant>
<constant name="WINDOW_EVENT_CLOSE_REQUEST" value="4" enum="WindowEvent">
</constant>
<constant name="WINDOW_EVENT_GO_BACK_REQUEST" value="5" enum="WindowEvent">
</constant>
<constant name="WINDOW_EVENT_DPI_CHANGE" value="6" enum="WindowEvent">
</constant>
<constant name="VSYNC_DISABLED" value="0" enum="VSyncMode">
No vertical synchronization, which means the engine will display frames as fast as possible (tearing may be visible).
</constant>
<constant name="VSYNC_ENABLED" value="1" enum="VSyncMode">
Default vertical synchronization mode, the image is displayed only on vertical blanking intervals (no tearing is visible).
</constant>
<constant name="VSYNC_ADAPTIVE" value="2" enum="VSyncMode">
Behaves like [constant VSYNC_DISABLED] when the framerate drops below the screen's refresh rate to reduce stuttering (tearing may be visible), otherwise vertical synchronization is enabled to avoid tearing.
</constant>
<constant name="VSYNC_MAILBOX" value="3" enum="VSyncMode">
Displays the most recent image in the queue on vertical blanking intervals, while rendering to the other images (no tearing is visible).
Although not guaranteed, the images can be rendered as fast as possible, which may reduce input lag.
</constant>
<constant name="DISPLAY_HANDLE" value="0" enum="HandleType">
Display handle:
- Linux: [code]X11::Display*[/code] for the display.
</constant>
<constant name="WINDOW_HANDLE" value="1" enum="HandleType">
Window handle:
- Windows: [code]HWND[/code] for the window.
- Linux: [code]X11::Window*[/code] for the window.
- MacOS: [code]NSWindow*[/code] for the window.
- iOS: [code]UIViewController*[/code] for the view controller.
- Android: [code]jObject[/code] for the activity.
</constant>
<constant name="WINDOW_VIEW" value="2" enum="HandleType">
Window view:
- MacOS: [code]NSView*[/code] for the window main view.
- iOS: [code]UIView*[/code] for the window main view.
</constant>
<constant name="TTS_UTTERANCE_STARTED" value="0" enum="TTSUtteranceEvent">
Utterance has begun to be spoken.
</constant>
<constant name="TTS_UTTERANCE_ENDED" value="1" enum="TTSUtteranceEvent">
Utterance was successfully finished.
</constant>
<constant name="TTS_UTTERANCE_CANCELED" value="2" enum="TTSUtteranceEvent">
Utterance was canceled, or TTS service was unable to process it.
</constant>
<constant name="TTS_UTTERANCE_BOUNDARY" value="3" enum="TTSUtteranceEvent">
Utterance reached a word or sentence boundary.
</constant>
</constants>
</class>
|