summaryrefslogtreecommitdiff
path: root/doc/classes/Window.xml
blob: 0e4e3a65f80e111cd4803181d515d520d4cee2aa (plain)
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
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Window" inherits="Viewport" version="4.0">
	<brief_description>
		Base class for all windows.
	</brief_description>
	<description>
		A node that creates a window.
	</description>
	<tutorials>
	</tutorials>
	<methods>
		<method name="can_draw" qualifiers="const">
			<return type="bool" />
			<description>
				Returns whether the window is being drawn to the screen.
			</description>
		</method>
		<method name="child_controls_changed">
			<return type="void" />
			<description>
			</description>
		</method>
		<method name="get_contents_minimum_size" qualifiers="const">
			<return type="Vector2" />
			<description>
				Returns the combined minimum size from the child [Control] nodes of the window.
			</description>
		</method>
		<method name="get_flag" qualifiers="const">
			<return type="bool" />
			<argument index="0" name="flag" type="int" enum="Window.Flags" />
			<description>
				Returns [code]true[/code] if the flag is set.
			</description>
		</method>
		<method name="get_layout_direction" qualifiers="const">
			<return type="int" enum="Window.LayoutDirection" />
			<description>
				Returns layout direction and text writing direction.
			</description>
		</method>
		<method name="get_real_size" qualifiers="const">
			<return type="Vector2i" />
			<description>
				Returns the window's size including its border.
			</description>
		</method>
		<method name="get_theme_color" qualifiers="const">
			<return type="Color" />
			<argument index="0" name="name" type="StringName" />
			<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;" />
			<description>
			</description>
		</method>
		<method name="get_theme_constant" qualifiers="const">
			<return type="int" />
			<argument index="0" name="name" type="StringName" />
			<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;" />
			<description>
			</description>
		</method>
		<method name="get_theme_default_base_scale" qualifiers="const">
			<return type="float" />
			<description>
			</description>
		</method>
		<method name="get_theme_default_font" qualifiers="const">
			<return type="Font" />
			<description>
			</description>
		</method>
		<method name="get_theme_default_font_size" qualifiers="const">
			<return type="int" />
			<description>
			</description>
		</method>
		<method name="get_theme_font" qualifiers="const">
			<return type="Font" />
			<argument index="0" name="name" type="StringName" />
			<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;" />
			<description>
				Returns the [Font] at [code]name[/code] if the theme has [code]theme_type[/code].
			</description>
		</method>
		<method name="get_theme_font_size" qualifiers="const">
			<return type="int" />
			<argument index="0" name="name" type="StringName" />
			<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;" />
			<description>
				Returns the font size at [code]name[/code] if the theme has [code]theme_type[/code].
			</description>
		</method>
		<method name="get_theme_icon" qualifiers="const">
			<return type="Texture2D" />
			<argument index="0" name="name" type="StringName" />
			<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;" />
			<description>
			</description>
		</method>
		<method name="get_theme_stylebox" qualifiers="const">
			<return type="StyleBox" />
			<argument index="0" name="name" type="StringName" />
			<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;" />
			<description>
			</description>
		</method>
		<method name="grab_focus">
			<return type="void" />
			<description>
				Causes the window to grab focus, allowing it to receive user input.
			</description>
		</method>
		<method name="has_focus" qualifiers="const">
			<return type="bool" />
			<description>
				Returns [code]true[/code] if the window is focused.
			</description>
		</method>
		<method name="has_theme_color" qualifiers="const">
			<return type="bool" />
			<argument index="0" name="name" type="StringName" />
			<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;" />
			<description>
			</description>
		</method>
		<method name="has_theme_constant" qualifiers="const">
			<return type="bool" />
			<argument index="0" name="name" type="StringName" />
			<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;" />
			<description>
			</description>
		</method>
		<method name="has_theme_font" qualifiers="const">
			<return type="bool" />
			<argument index="0" name="name" type="StringName" />
			<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;" />
			<description>
				Returns [code]true[/code] if [Font] with [code]name[/code] is in [code]theme_type[/code].
				Returns [code]false[/code] if the theme does not have [code]theme_type[/code].
			</description>
		</method>
		<method name="has_theme_font_size" qualifiers="const">
			<return type="bool" />
			<argument index="0" name="name" type="StringName" />
			<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;" />
			<description>
				Returns [code]true[/code] if font size with [code]name[/code] is in [code]theme_type[/code].
				Returns [code]false[/code] if the theme does not have [code]theme_type[/code].
			</description>
		</method>
		<method name="has_theme_icon" qualifiers="const">
			<return type="bool" />
			<argument index="0" name="name" type="StringName" />
			<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;" />
			<description>
			</description>
		</method>
		<method name="has_theme_stylebox" qualifiers="const">
			<return type="bool" />
			<argument index="0" name="name" type="StringName" />
			<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;" />
			<description>
			</description>
		</method>
		<method name="hide">
			<return type="void" />
			<description>
			</description>
		</method>
		<method name="is_embedded" qualifiers="const">
			<return type="bool" />
			<description>
				Returns [code]true[/code] if the window is currently embedded in another window.
			</description>
		</method>
		<method name="is_layout_rtl" qualifiers="const">
			<return type="bool" />
			<description>
				Returns [code]true[/code] if layout is right-to-left.
			</description>
		</method>
		<method name="is_maximize_allowed" qualifiers="const">
			<return type="bool" />
			<description>
			</description>
		</method>
		<method name="is_using_font_oversampling" qualifiers="const">
			<return type="bool" />
			<description>
			</description>
		</method>
		<method name="move_to_foreground">
			<return type="void" />
			<description>
			</description>
		</method>
		<method name="popup">
			<return type="void" />
			<argument index="0" name="rect" type="Rect2i" default="Rect2i(0, 0, 0, 0)" />
			<description>
			</description>
		</method>
		<method name="popup_centered">
			<return type="void" />
			<argument index="0" name="minsize" type="Vector2i" default="Vector2i(0, 0)" />
			<description>
			</description>
		</method>
		<method name="popup_centered_clamped">
			<return type="void" />
			<argument index="0" name="minsize" type="Vector2i" default="Vector2i(0, 0)" />
			<argument index="1" name="fallback_ratio" type="float" default="0.75" />
			<description>
			</description>
		</method>
		<method name="popup_centered_ratio">
			<return type="void" />
			<argument index="0" name="ratio" type="float" default="0.8" />
			<description>
			</description>
		</method>
		<method name="popup_on_parent">
			<return type="void" />
			<argument index="0" name="parent_rect" type="Rect2i" />
			<description>
			</description>
		</method>
		<method name="request_attention">
			<return type="void" />
			<description>
			</description>
		</method>
		<method name="reset_size">
			<return type="void" />
			<description>
				Resets the size to the minimum size, which is the max of [member min_size] and (if [member wrap_controls] is enabled) [method get_contents_minimum_size]. This is equivalent to calling [code]set_size(Vector2i())[/code] (or any size below the minimum).
			</description>
		</method>
		<method name="set_flag">
			<return type="void" />
			<argument index="0" name="flag" type="int" enum="Window.Flags" />
			<argument index="1" name="enabled" type="bool" />
			<description>
				Sets a specified window flag.
			</description>
		</method>
		<method name="set_ime_active">
			<return type="void" />
			<argument index="0" name="active" type="bool" />
			<description>
			</description>
		</method>
		<method name="set_ime_position">
			<return type="void" />
			<argument index="0" name="position" type="Vector2i" />
			<description>
			</description>
		</method>
		<method name="set_layout_direction">
			<return type="void" />
			<argument index="0" name="direction" type="int" enum="Window.LayoutDirection" />
			<description>
				Sets layout direction and text writing direction. Right-to-left layouts are necessary for certain languages (e.g. Arabic and Hebrew).
			</description>
		</method>
		<method name="set_use_font_oversampling">
			<return type="void" />
			<argument index="0" name="enable" type="bool" />
			<description>
			</description>
		</method>
		<method name="show">
			<return type="void" />
			<description>
			</description>
		</method>
	</methods>
	<members>
		<member name="always_on_top" type="bool" setter="set_flag" getter="get_flag" default="false">
			If [code]true[/code], the window will be on top of all other windows.
		</member>
		<member name="auto_translate" type="bool" setter="set_auto_translate" getter="is_auto_translating" default="true">
			Toggles if any text should automatically change to its translated version depending on the current locale.
		</member>
		<member name="borderless" type="bool" setter="set_flag" getter="get_flag" default="false">
			If [code]true[/code], the window will have no borders.
		</member>
		<member name="content_scale_aspect" type="int" setter="set_content_scale_aspect" getter="get_content_scale_aspect" enum="Window.ContentScaleAspect" default="0">
		</member>
		<member name="content_scale_factor" type="float" setter="set_content_scale_factor" getter="get_content_scale_factor" default="1.0">
		</member>
		<member name="content_scale_mode" type="int" setter="set_content_scale_mode" getter="get_content_scale_mode" enum="Window.ContentScaleMode" default="0">
		</member>
		<member name="content_scale_size" type="Vector2i" setter="set_content_scale_size" getter="get_content_scale_size" default="Vector2i(0, 0)">
		</member>
		<member name="current_screen" type="int" setter="set_current_screen" getter="get_current_screen" default="0">
			The screen the window is currently on.
		</member>
		<member name="exclusive" type="bool" setter="set_exclusive" getter="is_exclusive" default="false">
		</member>
		<member name="max_size" type="Vector2i" setter="set_max_size" getter="get_max_size" default="Vector2i(0, 0)">
		</member>
		<member name="min_size" type="Vector2i" setter="set_min_size" getter="get_min_size" default="Vector2i(0, 0)">
		</member>
		<member name="mode" type="int" setter="set_mode" getter="get_mode" enum="Window.Mode" default="0">
			Set's the window's current mode.
			[b]Note:[/b] Fullscreen mode is not exclusive fullscreen on Windows and Linux.
		</member>
		<member name="position" type="Vector2i" setter="set_position" getter="get_position" default="Vector2i(0, 0)">
			The window's position in pixels.
		</member>
		<member name="size" type="Vector2i" setter="set_size" getter="get_size" default="Vector2i(100, 100)">
			The window's size in pixels.
		</member>
		<member name="theme" type="Theme" setter="set_theme" getter="get_theme">
		</member>
		<member name="theme_type_variation" type="StringName" setter="set_theme_type_variation" getter="get_theme_type_variation" default="&amp;&quot;&quot;">
		</member>
		<member name="title" type="String" setter="set_title" getter="get_title" default="&quot;&quot;">
			The window's title.
		</member>
		<member name="transient" type="bool" setter="set_transient" getter="is_transient" default="false">
		</member>
		<member name="transparent" type="bool" setter="set_flag" getter="get_flag" default="false">
		</member>
		<member name="unfocusable" type="bool" setter="set_flag" getter="get_flag" default="false">
		</member>
		<member name="unresizable" type="bool" setter="set_flag" getter="get_flag" default="false">
			If [code]true[/code], the window can't be resized.
		</member>
		<member name="visible" type="bool" setter="set_visible" getter="is_visible" default="true">
			If [code]true[/code], the window is visible.
		</member>
		<member name="wrap_controls" type="bool" setter="set_wrap_controls" getter="is_wrapping_controls" default="false">
		</member>
	</members>
	<signals>
		<signal name="about_to_popup">
			<description>
			</description>
		</signal>
		<signal name="close_requested">
			<description>
			</description>
		</signal>
		<signal name="files_dropped">
			<argument index="0" name="files" type="PackedStringArray" />
			<description>
			</description>
		</signal>
		<signal name="focus_entered">
			<description>
			</description>
		</signal>
		<signal name="focus_exited">
			<description>
			</description>
		</signal>
		<signal name="go_back_requested">
			<description>
			</description>
		</signal>
		<signal name="mouse_entered">
			<description>
			</description>
		</signal>
		<signal name="mouse_exited">
			<description>
			</description>
		</signal>
		<signal name="theme_changed">
			<description>
			</description>
		</signal>
		<signal name="visibility_changed">
			<description>
			</description>
		</signal>
		<signal name="window_input">
			<argument index="0" name="event" type="InputEvent" />
			<description>
			</description>
		</signal>
	</signals>
	<constants>
		<constant name="NOTIFICATION_VISIBILITY_CHANGED" value="30">
		</constant>
		<constant name="MODE_WINDOWED" value="0" enum="Mode">
			Windowed mode.
		</constant>
		<constant name="MODE_MINIMIZED" value="1" enum="Mode">
			Minimized window mode.
		</constant>
		<constant name="MODE_MAXIMIZED" value="2" enum="Mode">
			Maximized window mode.
		</constant>
		<constant name="MODE_FULLSCREEN" value="3" enum="Mode">
			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="FLAG_RESIZE_DISABLED" value="0" enum="Flags">
			The window's ability to be resized.
		</constant>
		<constant name="FLAG_BORDERLESS" value="1" enum="Flags">
			Borderless window.
		</constant>
		<constant name="FLAG_ALWAYS_ON_TOP" value="2" enum="Flags">
			Flag for making the window always on top of all other windows.
		</constant>
		<constant name="FLAG_TRANSPARENT" value="3" enum="Flags">
		</constant>
		<constant name="FLAG_NO_FOCUS" value="4" enum="Flags">
		</constant>
		<constant name="FLAG_MAX" value="5" enum="Flags">
		</constant>
		<constant name="CONTENT_SCALE_MODE_DISABLED" value="0" enum="ContentScaleMode">
		</constant>
		<constant name="CONTENT_SCALE_MODE_CANVAS_ITEMS" value="1" enum="ContentScaleMode">
		</constant>
		<constant name="CONTENT_SCALE_MODE_VIEWPORT" value="2" enum="ContentScaleMode">
		</constant>
		<constant name="CONTENT_SCALE_ASPECT_IGNORE" value="0" enum="ContentScaleAspect">
		</constant>
		<constant name="CONTENT_SCALE_ASPECT_KEEP" value="1" enum="ContentScaleAspect">
		</constant>
		<constant name="CONTENT_SCALE_ASPECT_KEEP_WIDTH" value="2" enum="ContentScaleAspect">
		</constant>
		<constant name="CONTENT_SCALE_ASPECT_KEEP_HEIGHT" value="3" enum="ContentScaleAspect">
		</constant>
		<constant name="CONTENT_SCALE_ASPECT_EXPAND" value="4" enum="ContentScaleAspect">
		</constant>
		<constant name="LAYOUT_DIRECTION_INHERITED" value="0" enum="LayoutDirection">
			Automatic layout direction, determined from the parent control layout direction.
		</constant>
		<constant name="LAYOUT_DIRECTION_LOCALE" value="1" enum="LayoutDirection">
			Automatic layout direction, determined from the current locale.
		</constant>
		<constant name="LAYOUT_DIRECTION_LTR" value="2" enum="LayoutDirection">
			Left-to-right layout direction.
		</constant>
		<constant name="LAYOUT_DIRECTION_RTL" value="3" enum="LayoutDirection">
			Right-to-left layout direction.
		</constant>
	</constants>
	<theme_items>
		<theme_item name="title_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)">
		</theme_item>
		<theme_item name="title_outline_modulate" data_type="color" type="Color" default="Color(1, 1, 1, 1)">
			The color of the title outline.
		</theme_item>
		<theme_item name="close_h_ofs" data_type="constant" type="int" default="18">
		</theme_item>
		<theme_item name="close_v_ofs" data_type="constant" type="int" default="18">
		</theme_item>
		<theme_item name="resize_margin" data_type="constant" type="int" default="4">
		</theme_item>
		<theme_item name="scaleborder_size" data_type="constant" type="int" default="4">
		</theme_item>
		<theme_item name="title_height" data_type="constant" type="int" default="20">
		</theme_item>
		<theme_item name="title_outline_size" data_type="constant" type="int" default="0">
			The size of the title outline.
		</theme_item>
		<theme_item name="title_font" data_type="font" type="Font">
		</theme_item>
		<theme_item name="title_font_size" data_type="font_size" type="int">
			The size of the title font.
		</theme_item>
		<theme_item name="close" data_type="icon" type="Texture2D">
		</theme_item>
		<theme_item name="close_pressed" data_type="icon" type="Texture2D">
		</theme_item>
		<theme_item name="embedded_border" data_type="style" type="StyleBox">
		</theme_item>
	</theme_items>
</class>