1 /** 2 All User Interface nodes inherit from Control. A control's anchors and margins adapt its position and size relative to its parent. 3 4 Copyright: 5 Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. 6 Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) 7 Copyright (c) 2017-2018 Godot-D contributors 8 9 License: $(LINK2 https://opensource.org/licenses/MIT, MIT License) 10 11 12 */ 13 module godot.control; 14 import std.meta : AliasSeq, staticIndexOf; 15 import std.traits : Unqual; 16 import godot.d.meta; 17 import godot.core; 18 import godot.c; 19 import godot.d.bind; 20 import godot.d.reference; 21 import godot.object; 22 import godot.classdb; 23 import godot.canvasitem; 24 import godot.inputevent; 25 import godot.theme; 26 import godot.texture; 27 import godot.shader; 28 import godot.stylebox; 29 import godot.font; 30 import godot.node; 31 /** 32 All User Interface nodes inherit from Control. A control's anchors and margins adapt its position and size relative to its parent. 33 34 Base class for all User Interface or $(I UI) related nodes. `Control` features a bounding rectangle that defines its extents, an anchor position relative to its parent and margins that represent an offset to the anchor. The margins update automatically when the node, any of its parents, or the screen size change. 35 For more information on Godot's UI system, anchors, margins, and containers, see the related tutorials in the manual. To build flexible UIs, you'll need a mix of UI elements that inherit from `Control` and $(D Container) nodes. 36 $(B User Interface nodes and input) 37 Godot sends input events to the scene's root node first, by calling $(D Node._input). $(D Node._input) forwards the event down the node tree to the nodes under the mouse cursor, or on keyboard focus. To do so, it calls $(D MainLoop._inputEvent). Call $(D acceptEvent) so no other node receives the event. Once you accepted an input, it becomes handled so $(D Node._unhandledInput) will not process it. 38 Only one `Control` node can be in keyboard focus. Only the node in focus will receive keyboard events. To get the focus, call $(D grabFocus). `Control` nodes lose focus when another node grabs it, or if you hide the node in focus. 39 Set $(D mouseFilter) to MOUSE_FILTER_IGNORE to tell a `Control` node to ignore mouse or touch events. You'll need it if you place an icon on top of a button. 40 $(D Theme) resources change the Control's appearance. If you change the $(D Theme) on a `Control` node, it affects all of its children. To override some of the theme's parameters, call one of the `add_*_override` methods, like $(D addFontOverride). You can override the theme with the inspector. 41 */ 42 @GodotBaseClass struct Control 43 { 44 enum string _GODOT_internal_name = "Control"; 45 public: 46 @nogc nothrow: 47 union { godot_object _godot_object; CanvasItem _GODOT_base; } 48 alias _GODOT_base this; 49 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 50 package(godot) __gshared bool _classBindingInitialized = false; 51 package(godot) static struct _classBinding 52 { 53 __gshared: 54 @GodotName("_gui_input") GodotMethod!(void, InputEvent) _guiInput; 55 @GodotName("_get_minimum_size") GodotMethod!(Vector2) _getMinimumSize; 56 @GodotName("get_drag_data") GodotMethod!(GodotObject, Vector2) getDragData; 57 @GodotName("can_drop_data") GodotMethod!(bool, Vector2, Variant) canDropData; 58 @GodotName("drop_data") GodotMethod!(void, Vector2, Variant) dropData; 59 @GodotName("_make_custom_tooltip") GodotMethod!(GodotObject, String) _makeCustomTooltip; 60 @GodotName("_clips_input") GodotMethod!(bool) _clipsInput; 61 @GodotName("has_point") GodotMethod!(bool, Vector2) hasPoint; 62 @GodotName("_size_changed") GodotMethod!(void) _sizeChanged; 63 @GodotName("_update_minimum_size") GodotMethod!(void) _updateMinimumSize; 64 @GodotName("accept_event") GodotMethod!(void) acceptEvent; 65 @GodotName("get_minimum_size") GodotMethod!(Vector2) getMinimumSize; 66 @GodotName("get_combined_minimum_size") GodotMethod!(Vector2) getCombinedMinimumSize; 67 @GodotName("set_anchors_preset") GodotMethod!(void, long, bool) setAnchorsPreset; 68 @GodotName("set_margins_preset") GodotMethod!(void, long, long, long) setMarginsPreset; 69 @GodotName("set_anchors_and_margins_preset") GodotMethod!(void, long, long, long) setAnchorsAndMarginsPreset; 70 @GodotName("set_anchor") GodotMethod!(void, long, double, bool, bool) setAnchor; 71 @GodotName("_set_anchor") GodotMethod!(void, long, double) _setAnchor; 72 @GodotName("get_anchor") GodotMethod!(double, long) getAnchor; 73 @GodotName("set_margin") GodotMethod!(void, long, double) setMargin; 74 @GodotName("set_anchor_and_margin") GodotMethod!(void, long, double, double, bool) setAnchorAndMargin; 75 @GodotName("set_begin") GodotMethod!(void, Vector2) setBegin; 76 @GodotName("set_end") GodotMethod!(void, Vector2) setEnd; 77 @GodotName("set_position") GodotMethod!(void, Vector2) setPosition; 78 @GodotName("set_size") GodotMethod!(void, Vector2) setSize; 79 @GodotName("set_custom_minimum_size") GodotMethod!(void, Vector2) setCustomMinimumSize; 80 @GodotName("set_global_position") GodotMethod!(void, Vector2) setGlobalPosition; 81 @GodotName("set_rotation") GodotMethod!(void, double) setRotation; 82 @GodotName("set_rotation_degrees") GodotMethod!(void, double) setRotationDegrees; 83 @GodotName("set_scale") GodotMethod!(void, Vector2) setScale; 84 @GodotName("set_pivot_offset") GodotMethod!(void, Vector2) setPivotOffset; 85 @GodotName("get_margin") GodotMethod!(double, long) getMargin; 86 @GodotName("get_begin") GodotMethod!(Vector2) getBegin; 87 @GodotName("get_end") GodotMethod!(Vector2) getEnd; 88 @GodotName("get_position") GodotMethod!(Vector2) getPosition; 89 @GodotName("get_size") GodotMethod!(Vector2) getSize; 90 @GodotName("get_rotation") GodotMethod!(double) getRotation; 91 @GodotName("get_rotation_degrees") GodotMethod!(double) getRotationDegrees; 92 @GodotName("get_scale") GodotMethod!(Vector2) getScale; 93 @GodotName("get_pivot_offset") GodotMethod!(Vector2) getPivotOffset; 94 @GodotName("get_custom_minimum_size") GodotMethod!(Vector2) getCustomMinimumSize; 95 @GodotName("get_parent_area_size") GodotMethod!(Vector2) getParentAreaSize; 96 @GodotName("get_global_position") GodotMethod!(Vector2) getGlobalPosition; 97 @GodotName("get_rect") GodotMethod!(Rect2) getRect; 98 @GodotName("get_global_rect") GodotMethod!(Rect2) getGlobalRect; 99 @GodotName("show_modal") GodotMethod!(void, bool) showModal; 100 @GodotName("set_focus_mode") GodotMethod!(void, long) setFocusMode; 101 @GodotName("get_focus_mode") GodotMethod!(Control.FocusMode) getFocusMode; 102 @GodotName("has_focus") GodotMethod!(bool) hasFocus; 103 @GodotName("grab_focus") GodotMethod!(void) grabFocus; 104 @GodotName("release_focus") GodotMethod!(void) releaseFocus; 105 @GodotName("get_focus_owner") GodotMethod!(Control) getFocusOwner; 106 @GodotName("set_h_size_flags") GodotMethod!(void, long) setHSizeFlags; 107 @GodotName("get_h_size_flags") GodotMethod!(long) getHSizeFlags; 108 @GodotName("set_stretch_ratio") GodotMethod!(void, double) setStretchRatio; 109 @GodotName("get_stretch_ratio") GodotMethod!(double) getStretchRatio; 110 @GodotName("set_v_size_flags") GodotMethod!(void, long) setVSizeFlags; 111 @GodotName("get_v_size_flags") GodotMethod!(long) getVSizeFlags; 112 @GodotName("set_theme") GodotMethod!(void, Theme) setTheme; 113 @GodotName("get_theme") GodotMethod!(Theme) getTheme; 114 @GodotName("add_icon_override") GodotMethod!(void, String, Texture) addIconOverride; 115 @GodotName("add_shader_override") GodotMethod!(void, String, Shader) addShaderOverride; 116 @GodotName("add_stylebox_override") GodotMethod!(void, String, StyleBox) addStyleboxOverride; 117 @GodotName("add_font_override") GodotMethod!(void, String, Font) addFontOverride; 118 @GodotName("add_color_override") GodotMethod!(void, String, Color) addColorOverride; 119 @GodotName("add_constant_override") GodotMethod!(void, String, long) addConstantOverride; 120 @GodotName("get_icon") GodotMethod!(Texture, String, String) getIcon; 121 @GodotName("get_stylebox") GodotMethod!(StyleBox, String, String) getStylebox; 122 @GodotName("get_font") GodotMethod!(Font, String, String) getFont; 123 @GodotName("get_color") GodotMethod!(Color, String, String) getColor; 124 @GodotName("get_constant") GodotMethod!(long, String, String) getConstant; 125 @GodotName("has_icon_override") GodotMethod!(bool, String) hasIconOverride; 126 @GodotName("has_shader_override") GodotMethod!(bool, String) hasShaderOverride; 127 @GodotName("has_stylebox_override") GodotMethod!(bool, String) hasStyleboxOverride; 128 @GodotName("has_font_override") GodotMethod!(bool, String) hasFontOverride; 129 @GodotName("has_color_override") GodotMethod!(bool, String) hasColorOverride; 130 @GodotName("has_constant_override") GodotMethod!(bool, String) hasConstantOverride; 131 @GodotName("has_icon") GodotMethod!(bool, String, String) hasIcon; 132 @GodotName("has_stylebox") GodotMethod!(bool, String, String) hasStylebox; 133 @GodotName("has_font") GodotMethod!(bool, String, String) hasFont; 134 @GodotName("has_color") GodotMethod!(bool, String, String) hasColor; 135 @GodotName("has_constant") GodotMethod!(bool, String, String) hasConstant; 136 @GodotName("get_parent_control") GodotMethod!(Control) getParentControl; 137 @GodotName("set_h_grow_direction") GodotMethod!(void, long) setHGrowDirection; 138 @GodotName("get_h_grow_direction") GodotMethod!(Control.GrowDirection) getHGrowDirection; 139 @GodotName("set_v_grow_direction") GodotMethod!(void, long) setVGrowDirection; 140 @GodotName("get_v_grow_direction") GodotMethod!(Control.GrowDirection) getVGrowDirection; 141 @GodotName("set_tooltip") GodotMethod!(void, String) setTooltip; 142 @GodotName("get_tooltip") GodotMethod!(String, Vector2) getTooltip; 143 @GodotName("_get_tooltip") GodotMethod!(String) _getTooltip; 144 @GodotName("set_default_cursor_shape") GodotMethod!(void, long) setDefaultCursorShape; 145 @GodotName("get_default_cursor_shape") GodotMethod!(Control.CursorShape) getDefaultCursorShape; 146 @GodotName("get_cursor_shape") GodotMethod!(Control.CursorShape, Vector2) getCursorShape; 147 @GodotName("set_focus_neighbour") GodotMethod!(void, long, NodePath) setFocusNeighbour; 148 @GodotName("get_focus_neighbour") GodotMethod!(NodePath, long) getFocusNeighbour; 149 @GodotName("set_focus_next") GodotMethod!(void, NodePath) setFocusNext; 150 @GodotName("get_focus_next") GodotMethod!(NodePath) getFocusNext; 151 @GodotName("set_focus_previous") GodotMethod!(void, NodePath) setFocusPrevious; 152 @GodotName("get_focus_previous") GodotMethod!(NodePath) getFocusPrevious; 153 @GodotName("force_drag") GodotMethod!(void, Variant, GodotObject) forceDrag; 154 @GodotName("set_mouse_filter") GodotMethod!(void, long) setMouseFilter; 155 @GodotName("get_mouse_filter") GodotMethod!(Control.MouseFilter) getMouseFilter; 156 @GodotName("set_clip_contents") GodotMethod!(void, bool) setClipContents; 157 @GodotName("is_clipping_contents") GodotMethod!(bool) isClippingContents; 158 @GodotName("grab_click_focus") GodotMethod!(void) grabClickFocus; 159 @GodotName("set_drag_forwarding") GodotMethod!(void, GodotObject) setDragForwarding; 160 @GodotName("set_drag_preview") GodotMethod!(void, GodotObject) setDragPreview; 161 @GodotName("warp_mouse") GodotMethod!(void, Vector2) warpMouse; 162 @GodotName("minimum_size_changed") GodotMethod!(void) minimumSizeChanged; 163 @GodotName("_theme_changed") GodotMethod!(void) _themeChanged; 164 @GodotName("_font_changed") GodotMethod!(void) _fontChanged; 165 } 166 bool opEquals(in Control other) const { return _godot_object.ptr is other._godot_object.ptr; } 167 Control opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 168 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 169 mixin baseCasts; 170 static Control _new() 171 { 172 static godot_class_constructor constructor; 173 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("Control"); 174 if(constructor is null) return typeof(this).init; 175 return cast(Control)(constructor()); 176 } 177 @disable new(size_t s); 178 /// 179 enum Anchor : int 180 { 181 /** 182 Snaps one of the 4 anchor's sides to the origin of the node's `Rect`, in the top left. Use it with one of the `anchor_*` member variables, like $(D anchorLeft). To change all 4 anchors at once, use $(D setAnchorsPreset). 183 */ 184 anchorBegin = 0, 185 /** 186 Snaps one of the 4 anchor's sides to the end of the node's `Rect`, in the bottom right. Use it with one of the `anchor_*` member variables, like $(D anchorLeft). To change all 4 anchors at once, use $(D setAnchorsPreset). 187 */ 188 anchorEnd = 1, 189 } 190 /// 191 enum FocusMode : int 192 { 193 /** 194 The node cannot grab focus. Use with $(D focusMode). 195 */ 196 focusNone = 0, 197 /** 198 The node can only grab focus on mouse clicks. Use with $(D focusMode). 199 */ 200 focusClick = 1, 201 /** 202 The node can grab focus on mouse click or using the arrows and the Tab keys on the keyboard. Use with $(D focusMode). 203 */ 204 focusAll = 2, 205 } 206 /// 207 enum LayoutPresetMode : int 208 { 209 /** 210 211 */ 212 presetModeMinsize = 0, 213 /** 214 215 */ 216 presetModeKeepWidth = 1, 217 /** 218 219 */ 220 presetModeKeepHeight = 2, 221 /** 222 223 */ 224 presetModeKeepSize = 3, 225 } 226 /// 227 enum MouseFilter : int 228 { 229 /** 230 The control will receive mouse button input events through $(D _guiInput) if clicked on. These events are automatically marked as handled and they will not propagate further to other controls. 231 */ 232 mouseFilterStop = 0, 233 /** 234 The control will receive mouse button input events through $(D _guiInput) if clicked on. If this control does not handle the event, the parent control (if any) will be considered for a mouse click, and so on until there is no more parent control to potentially handle it. Even if no control handled it at all, the event will still be handled automatically. 235 */ 236 mouseFilterPass = 1, 237 /** 238 The control will not receive mouse button input events through $(D _guiInput) and will not block other controls from receiving these events. These events will also not be handled automatically. 239 */ 240 mouseFilterIgnore = 2, 241 } 242 /// 243 enum CursorShape : int 244 { 245 /** 246 Show the system's arrow mouse cursor when the user hovers the node. Use with $(D setDefaultCursorShape). 247 */ 248 cursorArrow = 0, 249 /** 250 Show the system's I-beam mouse cursor when the user hovers the node. The I-beam pointer has a shape similar to "I". It tells the user they can highlight or insert text. 251 */ 252 cursorIbeam = 1, 253 /** 254 Show the system's pointing hand mouse cursor when the user hovers the node. 255 */ 256 cursorPointingHand = 2, 257 /** 258 Show the system's cross mouse cursor when the user hovers the node. 259 */ 260 cursorCross = 3, 261 /** 262 Show the system's wait mouse cursor, often an hourglass, when the user hovers the node. 263 */ 264 cursorWait = 4, 265 /** 266 Show the system's busy mouse cursor when the user hovers the node. Often an hourglass. 267 */ 268 cursorBusy = 5, 269 /** 270 Show the system's drag mouse cursor, often a closed fist or a cross symbol, when the user hovers the node. It tells the user they're currently dragging an item, like a node in the Scene dock. 271 */ 272 cursorDrag = 6, 273 /** 274 Show the system's drop mouse cursor when the user hovers the node. It can be an open hand. It tells the user they can drop an item they're currently grabbing, like a node in the Scene dock. 275 */ 276 cursorCanDrop = 7, 277 /** 278 Show the system's forbidden mouse cursor when the user hovers the node. Often a crossed circle. 279 */ 280 cursorForbidden = 8, 281 /** 282 Show the system's vertical resize mouse cursor when the user hovers the node. A double headed vertical arrow. It tells the user they can resize the window or the panel vertically. 283 */ 284 cursorVsize = 9, 285 /** 286 Show the system's horizontal resize mouse cursor when the user hovers the node. A double headed horizontal arrow. It tells the user they can resize the window or the panel horizontally. 287 */ 288 cursorHsize = 10, 289 /** 290 Show the system's window resize mouse cursor when the user hovers the node. The cursor is a double headed arrow that goes from the bottom left to the top right. It tells the user they can resize the window or the panel both horizontally and vertically. 291 */ 292 cursorBdiagsize = 11, 293 /** 294 Show the system's window resize mouse cursor when the user hovers the node. The cursor is a double headed arrow that goes from the top left to the bottom right, the opposite of `CURSOR_BDIAGSIZE`. It tells the user they can resize the window or the panel both horizontally and vertically. 295 */ 296 cursorFdiagsize = 12, 297 /** 298 Show the system's move mouse cursor when the user hovers the node. It shows 2 double-headed arrows at a 90 degree angle. It tells the user they can move a UI element freely. 299 */ 300 cursorMove = 13, 301 /** 302 Show the system's vertical split mouse cursor when the user hovers the node. On Windows, it's the same as `CURSOR_VSIZE`. 303 */ 304 cursorVsplit = 14, 305 /** 306 Show the system's horizontal split mouse cursor when the user hovers the node. On Windows, it's the same as `CURSOR_HSIZE`. 307 */ 308 cursorHsplit = 15, 309 /** 310 Show the system's help mouse cursor when the user hovers the node, a question mark. 311 */ 312 cursorHelp = 16, 313 } 314 /// 315 enum GrowDirection : int 316 { 317 /** 318 319 */ 320 growDirectionBegin = 0, 321 /** 322 323 */ 324 growDirectionEnd = 1, 325 /** 326 327 */ 328 growDirectionBoth = 2, 329 } 330 /// 331 enum SizeFlags : int 332 { 333 /** 334 Tells the parent $(D Container) to expand the bounds of this node to fill all the available space without pushing any other node. Use with $(D sizeFlagsHorizontal) and $(D sizeFlagsVertical). 335 */ 336 sizeFill = 1, 337 /** 338 Tells the parent $(D Container) to let this node take all the available space on the axis you flag. If multiple neighboring nodes are set to expand, they'll share the space based on their stretch ratio. See $(D sizeFlagsStretchRatio). Use with $(D sizeFlagsHorizontal) and $(D sizeFlagsVertical). 339 */ 340 sizeExpand = 2, 341 /** 342 Sets the node's size flags to both fill and expand. See the 2 constants above for more information. 343 */ 344 sizeExpandFill = 3, 345 /** 346 Tells the parent $(D Container) to center the node in itself. It centers the control based on its bounding box, so it doesn't work with the fill or expand size flags. Use with $(D sizeFlagsHorizontal) and $(D sizeFlagsVertical). 347 */ 348 sizeShrinkCenter = 4, 349 /** 350 Tells the parent $(D Container) to align the node with its end, either the bottom or the right edge. It doesn't work with the fill or expand size flags. Use with $(D sizeFlagsHorizontal) and $(D sizeFlagsVertical). 351 */ 352 sizeShrinkEnd = 8, 353 } 354 /// 355 enum LayoutPreset : int 356 { 357 /** 358 Snap all 4 anchors to the top-left of the parent container's bounds. Use with $(D setAnchorsPreset). 359 */ 360 presetTopLeft = 0, 361 /** 362 Snap all 4 anchors to the top-right of the parent container's bounds. Use with $(D setAnchorsPreset). 363 */ 364 presetTopRight = 1, 365 /** 366 Snap all 4 anchors to the bottom-left of the parent container's bounds. Use with $(D setAnchorsPreset). 367 */ 368 presetBottomLeft = 2, 369 /** 370 Snap all 4 anchors to the bottom-right of the parent container's bounds. Use with $(D setAnchorsPreset). 371 */ 372 presetBottomRight = 3, 373 /** 374 Snap all 4 anchors to the center of the left edge of the parent container's bounds. Use with $(D setAnchorsPreset). 375 */ 376 presetCenterLeft = 4, 377 /** 378 Snap all 4 anchors to the center of the top edge of the parent container's bounds. Use with $(D setAnchorsPreset). 379 */ 380 presetCenterTop = 5, 381 /** 382 Snap all 4 anchors to the center of the right edge of the parent container's bounds. Use with $(D setAnchorsPreset). 383 */ 384 presetCenterRight = 6, 385 /** 386 Snap all 4 anchors to the center of the bottom edge of the parent container's bounds. Use with $(D setAnchorsPreset). 387 */ 388 presetCenterBottom = 7, 389 /** 390 Snap all 4 anchors to the center of the parent container's bounds. Use with $(D setAnchorsPreset). 391 */ 392 presetCenter = 8, 393 /** 394 Snap all 4 anchors to the left edge of the parent container. The left margin becomes relative to the left edge and the top margin relative to the top left corner of the node's parent. Use with $(D setAnchorsPreset). 395 */ 396 presetLeftWide = 9, 397 /** 398 Snap all 4 anchors to the top edge of the parent container. The left margin becomes relative to the top left corner, the top margin relative to the top edge, and the right margin relative to the top right corner of the node's parent. Use with $(D setAnchorsPreset). 399 */ 400 presetTopWide = 10, 401 /** 402 Snap all 4 anchors to the right edge of the parent container. The right margin becomes relative to the right edge and the top margin relative to the top right corner of the node's parent. Use with $(D setAnchorsPreset). 403 */ 404 presetRightWide = 11, 405 /** 406 Snap all 4 anchors to the bottom edge of the parent container. The left margin becomes relative to the bottom left corner, the bottom margin relative to the bottom edge, and the right margin relative to the bottom right corner of the node's parent. Use with $(D setAnchorsPreset). 407 */ 408 presetBottomWide = 12, 409 /** 410 Snap all 4 anchors to a vertical line that cuts the parent container in half. Use with $(D setAnchorsPreset). 411 */ 412 presetVcenterWide = 13, 413 /** 414 Snap all 4 anchors to a horizontal line that cuts the parent container in half. Use with $(D setAnchorsPreset). 415 */ 416 presetHcenterWide = 14, 417 /** 418 Snap all 4 anchors to the respective corners of the parent container. Set all 4 margins to 0 after you applied this preset and the `Control` will fit its parent container. Use with $(D setAnchorsPreset). 419 */ 420 presetWide = 15, 421 } 422 /// 423 enum Constants : int 424 { 425 anchorBegin = 0, 426 mouseFilterStop = 0, 427 focusNone = 0, 428 cursorArrow = 0, 429 growDirectionBegin = 0, 430 presetModeMinsize = 0, 431 presetTopLeft = 0, 432 mouseFilterPass = 1, 433 anchorEnd = 1, 434 sizeFill = 1, 435 presetModeKeepWidth = 1, 436 growDirectionEnd = 1, 437 cursorIbeam = 1, 438 focusClick = 1, 439 presetTopRight = 1, 440 focusAll = 2, 441 sizeExpand = 2, 442 presetModeKeepHeight = 2, 443 cursorPointingHand = 2, 444 mouseFilterIgnore = 2, 445 growDirectionBoth = 2, 446 presetBottomLeft = 2, 447 presetBottomRight = 3, 448 sizeExpandFill = 3, 449 presetModeKeepSize = 3, 450 cursorCross = 3, 451 presetCenterLeft = 4, 452 cursorWait = 4, 453 sizeShrinkCenter = 4, 454 cursorBusy = 5, 455 presetCenterTop = 5, 456 cursorDrag = 6, 457 presetCenterRight = 6, 458 presetCenterBottom = 7, 459 cursorCanDrop = 7, 460 cursorForbidden = 8, 461 presetCenter = 8, 462 sizeShrinkEnd = 8, 463 presetLeftWide = 9, 464 cursorVsize = 9, 465 presetTopWide = 10, 466 cursorHsize = 10, 467 presetRightWide = 11, 468 cursorBdiagsize = 11, 469 cursorFdiagsize = 12, 470 presetBottomWide = 12, 471 cursorMove = 13, 472 presetVcenterWide = 13, 473 cursorVsplit = 14, 474 presetHcenterWide = 14, 475 cursorHsplit = 15, 476 presetWide = 15, 477 cursorHelp = 16, 478 /** 479 Sent when the node changes size. Use $(D rectSize) to get the new size. 480 */ 481 notificationResized = 40, 482 /** 483 Sent when the mouse pointer enters the node. 484 */ 485 notificationMouseEnter = 41, 486 /** 487 Sent when the mouse pointer exits the node. 488 */ 489 notificationMouseExit = 42, 490 /** 491 Sent when the node grabs focus. 492 */ 493 notificationFocusEnter = 43, 494 /** 495 Sent when the node loses focus. 496 */ 497 notificationFocusExit = 44, 498 /** 499 Sent when the node's $(D theme) changes, right before Godot redraws the control. Happens when you call one of the `add_*_override` 500 */ 501 notificationThemeChanged = 45, 502 /** 503 Sent when an open modal dialog closes. See $(D showModal). 504 */ 505 notificationModalClose = 46, 506 /** 507 508 */ 509 notificationScrollBegin = 47, 510 /** 511 512 */ 513 notificationScrollEnd = 48, 514 } 515 /** 516 Use this method to process and accept inputs on UI elements. See $(D acceptEvent). 517 Replaces Godot 2's `_input_event`. 518 */ 519 void _guiInput(InputEvent event) 520 { 521 Array _GODOT_args = Array.empty_array; 522 _GODOT_args.append(event); 523 String _GODOT_method_name = String("_gui_input"); 524 this.callv(_GODOT_method_name, _GODOT_args); 525 } 526 /** 527 Returns the minimum size for this control. See $(D rectMinSize). 528 */ 529 Vector2 _getMinimumSize() 530 { 531 Array _GODOT_args = Array.empty_array; 532 String _GODOT_method_name = String("_get_minimum_size"); 533 return this.callv(_GODOT_method_name, _GODOT_args).as!(RefOrT!Vector2); 534 } 535 /** 536 Godot calls this method to get data that can be dragged and dropped onto controls that expect drop data. Return null if there is no data to drag. Controls that want to receive drop data should implement $(D canDropData) and $(D dropData). `position` is local to this control. Drag may be forced with $(D forceDrag). 537 A preview that will follow the mouse that should represent the data can be set with $(D setDragPreview). A good time to set the preview is in this method. 538 539 540 extends Control 541 542 func get_drag_data(position): 543 var mydata = make_data() 544 set_drag_preview(make_preview(mydata)) 545 return mydata 546 547 548 */ 549 GodotObject getDragData(in Vector2 position) 550 { 551 Array _GODOT_args = Array.empty_array; 552 _GODOT_args.append(position); 553 String _GODOT_method_name = String("get_drag_data"); 554 return this.callv(_GODOT_method_name, _GODOT_args).as!(RefOrT!GodotObject); 555 } 556 /** 557 Godot calls this method to test if `data` from a control's $(D getDragData) can be dropped at `position`. `position` is local to this control. 558 This method should only be used to test the data. Process the data in $(D dropData). 559 560 561 extends Control 562 563 func can_drop_data(position, data): 564 # check position if it is relevant to you 565 # otherwise just check data 566 return typeof(data) == TYPE_DICTIONARY and data.has('expected') 567 568 569 */ 570 bool canDropData(VariantArg1)(in Vector2 position, in VariantArg1 data) 571 { 572 Array _GODOT_args = Array.empty_array; 573 _GODOT_args.append(position); 574 _GODOT_args.append(data); 575 String _GODOT_method_name = String("can_drop_data"); 576 return this.callv(_GODOT_method_name, _GODOT_args).as!(RefOrT!bool); 577 } 578 /** 579 Godot calls this method to pass you the `data` from a control's $(D getDragData) result. Godot first calls $(D canDropData) to test if `data` is allowed to drop at `position` where `position` is local to this control. 580 581 582 extends ColorRect 583 584 func can_drop_data(position, data): 585 return typeof(data) == TYPE_DICTIONARY and data.has('color') 586 587 func drop_data(position, data): 588 color = data$(D 'color') 589 590 591 */ 592 void dropData(VariantArg1)(in Vector2 position, in VariantArg1 data) 593 { 594 Array _GODOT_args = Array.empty_array; 595 _GODOT_args.append(position); 596 _GODOT_args.append(data); 597 String _GODOT_method_name = String("drop_data"); 598 this.callv(_GODOT_method_name, _GODOT_args); 599 } 600 /** 601 602 */ 603 GodotObject _makeCustomTooltip(StringArg0)(in StringArg0 for_text) 604 { 605 Array _GODOT_args = Array.empty_array; 606 _GODOT_args.append(for_text); 607 String _GODOT_method_name = String("_make_custom_tooltip"); 608 return this.callv(_GODOT_method_name, _GODOT_args).as!(RefOrT!GodotObject); 609 } 610 /** 611 612 */ 613 bool _clipsInput() 614 { 615 Array _GODOT_args = Array.empty_array; 616 String _GODOT_method_name = String("_clips_input"); 617 return this.callv(_GODOT_method_name, _GODOT_args).as!(RefOrT!bool); 618 } 619 /** 620 621 */ 622 bool hasPoint(in Vector2 point) 623 { 624 Array _GODOT_args = Array.empty_array; 625 _GODOT_args.append(point); 626 String _GODOT_method_name = String("has_point"); 627 return this.callv(_GODOT_method_name, _GODOT_args).as!(RefOrT!bool); 628 } 629 /** 630 631 */ 632 void _sizeChanged() 633 { 634 Array _GODOT_args = Array.empty_array; 635 String _GODOT_method_name = String("_size_changed"); 636 this.callv(_GODOT_method_name, _GODOT_args); 637 } 638 /** 639 640 */ 641 void _updateMinimumSize() 642 { 643 Array _GODOT_args = Array.empty_array; 644 String _GODOT_method_name = String("_update_minimum_size"); 645 this.callv(_GODOT_method_name, _GODOT_args); 646 } 647 /** 648 Marks an input event as handled. Once you accept an input event, it stops propagating, even to nodes listening to $(D Node._unhandledInput) or $(D Node._unhandledKeyInput). 649 */ 650 void acceptEvent() 651 { 652 checkClassBinding!(typeof(this))(); 653 ptrcall!(void)(_classBinding.acceptEvent, _godot_object); 654 } 655 /** 656 Returns the minimum size for this control. See $(D rectMinSize). 657 */ 658 Vector2 getMinimumSize() const 659 { 660 checkClassBinding!(typeof(this))(); 661 return ptrcall!(Vector2)(_classBinding.getMinimumSize, _godot_object); 662 } 663 /** 664 665 */ 666 Vector2 getCombinedMinimumSize() const 667 { 668 checkClassBinding!(typeof(this))(); 669 return ptrcall!(Vector2)(_classBinding.getCombinedMinimumSize, _godot_object); 670 } 671 /** 672 673 */ 674 void setAnchorsPreset(in long preset, in bool keep_margin = false) 675 { 676 checkClassBinding!(typeof(this))(); 677 ptrcall!(void)(_classBinding.setAnchorsPreset, _godot_object, preset, keep_margin); 678 } 679 /** 680 681 */ 682 void setMarginsPreset(in long preset, in long resize_mode = 0, in long margin = 0) 683 { 684 checkClassBinding!(typeof(this))(); 685 ptrcall!(void)(_classBinding.setMarginsPreset, _godot_object, preset, resize_mode, margin); 686 } 687 /** 688 689 */ 690 void setAnchorsAndMarginsPreset(in long preset, in long resize_mode = 0, in long margin = 0) 691 { 692 checkClassBinding!(typeof(this))(); 693 ptrcall!(void)(_classBinding.setAnchorsAndMarginsPreset, _godot_object, preset, resize_mode, margin); 694 } 695 /** 696 697 */ 698 void setAnchor(in long margin, in double anchor, in bool keep_margin = false, in bool push_opposite_anchor = true) 699 { 700 checkClassBinding!(typeof(this))(); 701 ptrcall!(void)(_classBinding.setAnchor, _godot_object, margin, anchor, keep_margin, push_opposite_anchor); 702 } 703 /** 704 705 */ 706 void _setAnchor(in long margin, in double anchor) 707 { 708 Array _GODOT_args = Array.empty_array; 709 _GODOT_args.append(margin); 710 _GODOT_args.append(anchor); 711 String _GODOT_method_name = String("_set_anchor"); 712 this.callv(_GODOT_method_name, _GODOT_args); 713 } 714 /** 715 716 */ 717 double getAnchor(in long margin) const 718 { 719 checkClassBinding!(typeof(this))(); 720 return ptrcall!(double)(_classBinding.getAnchor, _godot_object, margin); 721 } 722 /** 723 724 */ 725 void setMargin(in long margin, in double offset) 726 { 727 checkClassBinding!(typeof(this))(); 728 ptrcall!(void)(_classBinding.setMargin, _godot_object, margin, offset); 729 } 730 /** 731 732 */ 733 void setAnchorAndMargin(in long margin, in double anchor, in double offset, in bool push_opposite_anchor = false) 734 { 735 checkClassBinding!(typeof(this))(); 736 ptrcall!(void)(_classBinding.setAnchorAndMargin, _godot_object, margin, anchor, offset, push_opposite_anchor); 737 } 738 /** 739 Sets $(D marginLeft) and $(D marginTop) at the same time. 740 */ 741 void setBegin(in Vector2 position) 742 { 743 checkClassBinding!(typeof(this))(); 744 ptrcall!(void)(_classBinding.setBegin, _godot_object, position); 745 } 746 /** 747 Sets $(D marginRight) and $(D marginBottom) at the same time. 748 */ 749 void setEnd(in Vector2 position) 750 { 751 checkClassBinding!(typeof(this))(); 752 ptrcall!(void)(_classBinding.setEnd, _godot_object, position); 753 } 754 /** 755 756 */ 757 void setPosition(in Vector2 position) 758 { 759 checkClassBinding!(typeof(this))(); 760 ptrcall!(void)(_classBinding.setPosition, _godot_object, position); 761 } 762 /** 763 764 */ 765 void setSize(in Vector2 size) 766 { 767 checkClassBinding!(typeof(this))(); 768 ptrcall!(void)(_classBinding.setSize, _godot_object, size); 769 } 770 /** 771 772 */ 773 void setCustomMinimumSize(in Vector2 size) 774 { 775 checkClassBinding!(typeof(this))(); 776 ptrcall!(void)(_classBinding.setCustomMinimumSize, _godot_object, size); 777 } 778 /** 779 780 */ 781 void setGlobalPosition(in Vector2 position) 782 { 783 checkClassBinding!(typeof(this))(); 784 ptrcall!(void)(_classBinding.setGlobalPosition, _godot_object, position); 785 } 786 /** 787 Sets the rotation (in radians). 788 */ 789 void setRotation(in double radians) 790 { 791 checkClassBinding!(typeof(this))(); 792 ptrcall!(void)(_classBinding.setRotation, _godot_object, radians); 793 } 794 /** 795 796 */ 797 void setRotationDegrees(in double degrees) 798 { 799 checkClassBinding!(typeof(this))(); 800 ptrcall!(void)(_classBinding.setRotationDegrees, _godot_object, degrees); 801 } 802 /** 803 804 */ 805 void setScale(in Vector2 scale) 806 { 807 checkClassBinding!(typeof(this))(); 808 ptrcall!(void)(_classBinding.setScale, _godot_object, scale); 809 } 810 /** 811 812 */ 813 void setPivotOffset(in Vector2 pivot_offset) 814 { 815 checkClassBinding!(typeof(this))(); 816 ptrcall!(void)(_classBinding.setPivotOffset, _godot_object, pivot_offset); 817 } 818 /** 819 820 */ 821 double getMargin(in long margin) const 822 { 823 checkClassBinding!(typeof(this))(); 824 return ptrcall!(double)(_classBinding.getMargin, _godot_object, margin); 825 } 826 /** 827 Returns $(D marginLeft) and $(D marginTop). See also $(D rectPosition). 828 */ 829 Vector2 getBegin() const 830 { 831 checkClassBinding!(typeof(this))(); 832 return ptrcall!(Vector2)(_classBinding.getBegin, _godot_object); 833 } 834 /** 835 Returns $(D marginRight) and $(D marginBottom). 836 */ 837 Vector2 getEnd() const 838 { 839 checkClassBinding!(typeof(this))(); 840 return ptrcall!(Vector2)(_classBinding.getEnd, _godot_object); 841 } 842 /** 843 844 */ 845 Vector2 getPosition() const 846 { 847 checkClassBinding!(typeof(this))(); 848 return ptrcall!(Vector2)(_classBinding.getPosition, _godot_object); 849 } 850 /** 851 852 */ 853 Vector2 getSize() const 854 { 855 checkClassBinding!(typeof(this))(); 856 return ptrcall!(Vector2)(_classBinding.getSize, _godot_object); 857 } 858 /** 859 Returns the rotation (in radians). 860 */ 861 double getRotation() const 862 { 863 checkClassBinding!(typeof(this))(); 864 return ptrcall!(double)(_classBinding.getRotation, _godot_object); 865 } 866 /** 867 868 */ 869 double getRotationDegrees() const 870 { 871 checkClassBinding!(typeof(this))(); 872 return ptrcall!(double)(_classBinding.getRotationDegrees, _godot_object); 873 } 874 /** 875 876 */ 877 Vector2 getScale() const 878 { 879 checkClassBinding!(typeof(this))(); 880 return ptrcall!(Vector2)(_classBinding.getScale, _godot_object); 881 } 882 /** 883 884 */ 885 Vector2 getPivotOffset() const 886 { 887 checkClassBinding!(typeof(this))(); 888 return ptrcall!(Vector2)(_classBinding.getPivotOffset, _godot_object); 889 } 890 /** 891 892 */ 893 Vector2 getCustomMinimumSize() const 894 { 895 checkClassBinding!(typeof(this))(); 896 return ptrcall!(Vector2)(_classBinding.getCustomMinimumSize, _godot_object); 897 } 898 /** 899 Returns the width/height occupied in the parent control. 900 */ 901 Vector2 getParentAreaSize() const 902 { 903 checkClassBinding!(typeof(this))(); 904 return ptrcall!(Vector2)(_classBinding.getParentAreaSize, _godot_object); 905 } 906 /** 907 908 */ 909 Vector2 getGlobalPosition() const 910 { 911 checkClassBinding!(typeof(this))(); 912 return ptrcall!(Vector2)(_classBinding.getGlobalPosition, _godot_object); 913 } 914 /** 915 Returns the position and size of the control relative to the top-left corner of the parent Control. See $(D rectPosition) and $(D rectSize). 916 */ 917 Rect2 getRect() const 918 { 919 checkClassBinding!(typeof(this))(); 920 return ptrcall!(Rect2)(_classBinding.getRect, _godot_object); 921 } 922 /** 923 Returns the position and size of the control relative to the top-left corner of the screen. See $(D rectPosition) and $(D rectSize). 924 */ 925 Rect2 getGlobalRect() const 926 { 927 checkClassBinding!(typeof(this))(); 928 return ptrcall!(Rect2)(_classBinding.getGlobalRect, _godot_object); 929 } 930 /** 931 Displays a control as modal. Control must be a subwindow. Modal controls capture the input signals until closed or the area outside them is accessed. When a modal control loses focus, or the ESC key is pressed, they automatically hide. Modal controls are used extensively for popup dialogs and menus. 932 */ 933 void showModal(in bool exclusive = false) 934 { 935 checkClassBinding!(typeof(this))(); 936 ptrcall!(void)(_classBinding.showModal, _godot_object, exclusive); 937 } 938 /** 939 940 */ 941 void setFocusMode(in long mode) 942 { 943 checkClassBinding!(typeof(this))(); 944 ptrcall!(void)(_classBinding.setFocusMode, _godot_object, mode); 945 } 946 /** 947 948 */ 949 Control.FocusMode getFocusMode() const 950 { 951 checkClassBinding!(typeof(this))(); 952 return ptrcall!(Control.FocusMode)(_classBinding.getFocusMode, _godot_object); 953 } 954 /** 955 Returns `true` if this is the current focused control. See $(D focusMode). 956 */ 957 bool hasFocus() const 958 { 959 checkClassBinding!(typeof(this))(); 960 return ptrcall!(bool)(_classBinding.hasFocus, _godot_object); 961 } 962 /** 963 Steal the focus from another control and become the focused control (see $(D setFocusMode)). 964 */ 965 void grabFocus() 966 { 967 checkClassBinding!(typeof(this))(); 968 ptrcall!(void)(_classBinding.grabFocus, _godot_object); 969 } 970 /** 971 Give up the focus. No other control will be able to receive keyboard input. 972 */ 973 void releaseFocus() 974 { 975 checkClassBinding!(typeof(this))(); 976 ptrcall!(void)(_classBinding.releaseFocus, _godot_object); 977 } 978 /** 979 Returns the control that has the keyboard focus or `null` if none. 980 */ 981 Control getFocusOwner() const 982 { 983 checkClassBinding!(typeof(this))(); 984 return ptrcall!(Control)(_classBinding.getFocusOwner, _godot_object); 985 } 986 /** 987 988 */ 989 void setHSizeFlags(in long flags) 990 { 991 checkClassBinding!(typeof(this))(); 992 ptrcall!(void)(_classBinding.setHSizeFlags, _godot_object, flags); 993 } 994 /** 995 996 */ 997 long getHSizeFlags() const 998 { 999 checkClassBinding!(typeof(this))(); 1000 return ptrcall!(long)(_classBinding.getHSizeFlags, _godot_object); 1001 } 1002 /** 1003 1004 */ 1005 void setStretchRatio(in double ratio) 1006 { 1007 checkClassBinding!(typeof(this))(); 1008 ptrcall!(void)(_classBinding.setStretchRatio, _godot_object, ratio); 1009 } 1010 /** 1011 1012 */ 1013 double getStretchRatio() const 1014 { 1015 checkClassBinding!(typeof(this))(); 1016 return ptrcall!(double)(_classBinding.getStretchRatio, _godot_object); 1017 } 1018 /** 1019 1020 */ 1021 void setVSizeFlags(in long flags) 1022 { 1023 checkClassBinding!(typeof(this))(); 1024 ptrcall!(void)(_classBinding.setVSizeFlags, _godot_object, flags); 1025 } 1026 /** 1027 1028 */ 1029 long getVSizeFlags() const 1030 { 1031 checkClassBinding!(typeof(this))(); 1032 return ptrcall!(long)(_classBinding.getVSizeFlags, _godot_object); 1033 } 1034 /** 1035 1036 */ 1037 void setTheme(Theme theme) 1038 { 1039 checkClassBinding!(typeof(this))(); 1040 ptrcall!(void)(_classBinding.setTheme, _godot_object, theme); 1041 } 1042 /** 1043 1044 */ 1045 Ref!Theme getTheme() const 1046 { 1047 checkClassBinding!(typeof(this))(); 1048 return ptrcall!(Theme)(_classBinding.getTheme, _godot_object); 1049 } 1050 /** 1051 Overrides the `name` icon in the $(D theme) resource the node uses. If `icon` is empty, Godot clears the override. 1052 */ 1053 void addIconOverride(StringArg0)(in StringArg0 name, Texture texture) 1054 { 1055 checkClassBinding!(typeof(this))(); 1056 ptrcall!(void)(_classBinding.addIconOverride, _godot_object, name, texture); 1057 } 1058 /** 1059 Overrides the `name` shader in the $(D theme) resource the node uses. If `shader` is empty, Godot clears the override. 1060 */ 1061 void addShaderOverride(StringArg0)(in StringArg0 name, Shader shader) 1062 { 1063 checkClassBinding!(typeof(this))(); 1064 ptrcall!(void)(_classBinding.addShaderOverride, _godot_object, name, shader); 1065 } 1066 /** 1067 Overrides the `name` $(D Stylebox) in the $(D theme) resource the node uses. If `stylebox` is empty, Godot clears the override. 1068 */ 1069 void addStyleboxOverride(StringArg0)(in StringArg0 name, StyleBox stylebox) 1070 { 1071 checkClassBinding!(typeof(this))(); 1072 ptrcall!(void)(_classBinding.addStyleboxOverride, _godot_object, name, stylebox); 1073 } 1074 /** 1075 Overrides the `name` font in the $(D theme) resource the node uses. If `font` is empty, Godot clears the override. 1076 */ 1077 void addFontOverride(StringArg0)(in StringArg0 name, Font font) 1078 { 1079 checkClassBinding!(typeof(this))(); 1080 ptrcall!(void)(_classBinding.addFontOverride, _godot_object, name, font); 1081 } 1082 /** 1083 Overrides the color in the $(D theme) resource the node uses. 1084 */ 1085 void addColorOverride(StringArg0)(in StringArg0 name, in Color color) 1086 { 1087 checkClassBinding!(typeof(this))(); 1088 ptrcall!(void)(_classBinding.addColorOverride, _godot_object, name, color); 1089 } 1090 /** 1091 Overrides an integer constant in the $(D theme) resource the node uses. If the `constant` is invalid, Godot clears the override. 1092 */ 1093 void addConstantOverride(StringArg0)(in StringArg0 name, in long constant) 1094 { 1095 checkClassBinding!(typeof(this))(); 1096 ptrcall!(void)(_classBinding.addConstantOverride, _godot_object, name, constant); 1097 } 1098 /** 1099 1100 */ 1101 Ref!Texture getIcon(StringArg0, StringArg1)(in StringArg0 name, in StringArg1 type = "") const 1102 { 1103 checkClassBinding!(typeof(this))(); 1104 return ptrcall!(Texture)(_classBinding.getIcon, _godot_object, name, type); 1105 } 1106 /** 1107 1108 */ 1109 Ref!StyleBox getStylebox(StringArg0, StringArg1)(in StringArg0 name, in StringArg1 type = "") const 1110 { 1111 checkClassBinding!(typeof(this))(); 1112 return ptrcall!(StyleBox)(_classBinding.getStylebox, _godot_object, name, type); 1113 } 1114 /** 1115 1116 */ 1117 Ref!Font getFont(StringArg0, StringArg1)(in StringArg0 name, in StringArg1 type = "") const 1118 { 1119 checkClassBinding!(typeof(this))(); 1120 return ptrcall!(Font)(_classBinding.getFont, _godot_object, name, type); 1121 } 1122 /** 1123 1124 */ 1125 Color getColor(StringArg0, StringArg1)(in StringArg0 name, in StringArg1 type = "") const 1126 { 1127 checkClassBinding!(typeof(this))(); 1128 return ptrcall!(Color)(_classBinding.getColor, _godot_object, name, type); 1129 } 1130 /** 1131 1132 */ 1133 long getConstant(StringArg0, StringArg1)(in StringArg0 name, in StringArg1 type = "") const 1134 { 1135 checkClassBinding!(typeof(this))(); 1136 return ptrcall!(long)(_classBinding.getConstant, _godot_object, name, type); 1137 } 1138 /** 1139 1140 */ 1141 bool hasIconOverride(StringArg0)(in StringArg0 name) const 1142 { 1143 checkClassBinding!(typeof(this))(); 1144 return ptrcall!(bool)(_classBinding.hasIconOverride, _godot_object, name); 1145 } 1146 /** 1147 1148 */ 1149 bool hasShaderOverride(StringArg0)(in StringArg0 name) const 1150 { 1151 checkClassBinding!(typeof(this))(); 1152 return ptrcall!(bool)(_classBinding.hasShaderOverride, _godot_object, name); 1153 } 1154 /** 1155 1156 */ 1157 bool hasStyleboxOverride(StringArg0)(in StringArg0 name) const 1158 { 1159 checkClassBinding!(typeof(this))(); 1160 return ptrcall!(bool)(_classBinding.hasStyleboxOverride, _godot_object, name); 1161 } 1162 /** 1163 1164 */ 1165 bool hasFontOverride(StringArg0)(in StringArg0 name) const 1166 { 1167 checkClassBinding!(typeof(this))(); 1168 return ptrcall!(bool)(_classBinding.hasFontOverride, _godot_object, name); 1169 } 1170 /** 1171 1172 */ 1173 bool hasColorOverride(StringArg0)(in StringArg0 name) const 1174 { 1175 checkClassBinding!(typeof(this))(); 1176 return ptrcall!(bool)(_classBinding.hasColorOverride, _godot_object, name); 1177 } 1178 /** 1179 1180 */ 1181 bool hasConstantOverride(StringArg0)(in StringArg0 name) const 1182 { 1183 checkClassBinding!(typeof(this))(); 1184 return ptrcall!(bool)(_classBinding.hasConstantOverride, _godot_object, name); 1185 } 1186 /** 1187 1188 */ 1189 bool hasIcon(StringArg0, StringArg1)(in StringArg0 name, in StringArg1 type = "") const 1190 { 1191 checkClassBinding!(typeof(this))(); 1192 return ptrcall!(bool)(_classBinding.hasIcon, _godot_object, name, type); 1193 } 1194 /** 1195 1196 */ 1197 bool hasStylebox(StringArg0, StringArg1)(in StringArg0 name, in StringArg1 type = "") const 1198 { 1199 checkClassBinding!(typeof(this))(); 1200 return ptrcall!(bool)(_classBinding.hasStylebox, _godot_object, name, type); 1201 } 1202 /** 1203 1204 */ 1205 bool hasFont(StringArg0, StringArg1)(in StringArg0 name, in StringArg1 type = "") const 1206 { 1207 checkClassBinding!(typeof(this))(); 1208 return ptrcall!(bool)(_classBinding.hasFont, _godot_object, name, type); 1209 } 1210 /** 1211 1212 */ 1213 bool hasColor(StringArg0, StringArg1)(in StringArg0 name, in StringArg1 type = "") const 1214 { 1215 checkClassBinding!(typeof(this))(); 1216 return ptrcall!(bool)(_classBinding.hasColor, _godot_object, name, type); 1217 } 1218 /** 1219 1220 */ 1221 bool hasConstant(StringArg0, StringArg1)(in StringArg0 name, in StringArg1 type = "") const 1222 { 1223 checkClassBinding!(typeof(this))(); 1224 return ptrcall!(bool)(_classBinding.hasConstant, _godot_object, name, type); 1225 } 1226 /** 1227 Returns the parent control node. 1228 */ 1229 Control getParentControl() const 1230 { 1231 checkClassBinding!(typeof(this))(); 1232 return ptrcall!(Control)(_classBinding.getParentControl, _godot_object); 1233 } 1234 /** 1235 1236 */ 1237 void setHGrowDirection(in long direction) 1238 { 1239 checkClassBinding!(typeof(this))(); 1240 ptrcall!(void)(_classBinding.setHGrowDirection, _godot_object, direction); 1241 } 1242 /** 1243 1244 */ 1245 Control.GrowDirection getHGrowDirection() const 1246 { 1247 checkClassBinding!(typeof(this))(); 1248 return ptrcall!(Control.GrowDirection)(_classBinding.getHGrowDirection, _godot_object); 1249 } 1250 /** 1251 1252 */ 1253 void setVGrowDirection(in long direction) 1254 { 1255 checkClassBinding!(typeof(this))(); 1256 ptrcall!(void)(_classBinding.setVGrowDirection, _godot_object, direction); 1257 } 1258 /** 1259 1260 */ 1261 Control.GrowDirection getVGrowDirection() const 1262 { 1263 checkClassBinding!(typeof(this))(); 1264 return ptrcall!(Control.GrowDirection)(_classBinding.getVGrowDirection, _godot_object); 1265 } 1266 /** 1267 1268 */ 1269 void setTooltip(StringArg0)(in StringArg0 tooltip) 1270 { 1271 checkClassBinding!(typeof(this))(); 1272 ptrcall!(void)(_classBinding.setTooltip, _godot_object, tooltip); 1273 } 1274 /** 1275 Returns the tooltip, which will appear when the cursor is resting over this control. 1276 */ 1277 String getTooltip(in Vector2 at_position = Vector2(0, 0)) const 1278 { 1279 checkClassBinding!(typeof(this))(); 1280 return ptrcall!(String)(_classBinding.getTooltip, _godot_object, at_position); 1281 } 1282 /** 1283 1284 */ 1285 String _getTooltip() const 1286 { 1287 Array _GODOT_args = Array.empty_array; 1288 String _GODOT_method_name = String("_get_tooltip"); 1289 return this.callv(_GODOT_method_name, _GODOT_args).as!(RefOrT!String); 1290 } 1291 /** 1292 1293 */ 1294 void setDefaultCursorShape(in long shape) 1295 { 1296 checkClassBinding!(typeof(this))(); 1297 ptrcall!(void)(_classBinding.setDefaultCursorShape, _godot_object, shape); 1298 } 1299 /** 1300 1301 */ 1302 Control.CursorShape getDefaultCursorShape() const 1303 { 1304 checkClassBinding!(typeof(this))(); 1305 return ptrcall!(Control.CursorShape)(_classBinding.getDefaultCursorShape, _godot_object); 1306 } 1307 /** 1308 Returns the mouse cursor shape the control displays on mouse hover. See $(D cursorshape). 1309 */ 1310 Control.CursorShape getCursorShape(in Vector2 position = Vector2(0, 0)) const 1311 { 1312 checkClassBinding!(typeof(this))(); 1313 return ptrcall!(Control.CursorShape)(_classBinding.getCursorShape, _godot_object, position); 1314 } 1315 /** 1316 1317 */ 1318 void setFocusNeighbour(NodePathArg1)(in long margin, in NodePathArg1 neighbour) 1319 { 1320 checkClassBinding!(typeof(this))(); 1321 ptrcall!(void)(_classBinding.setFocusNeighbour, _godot_object, margin, neighbour); 1322 } 1323 /** 1324 1325 */ 1326 NodePath getFocusNeighbour(in long margin) const 1327 { 1328 checkClassBinding!(typeof(this))(); 1329 return ptrcall!(NodePath)(_classBinding.getFocusNeighbour, _godot_object, margin); 1330 } 1331 /** 1332 1333 */ 1334 void setFocusNext(NodePathArg0)(in NodePathArg0 next) 1335 { 1336 checkClassBinding!(typeof(this))(); 1337 ptrcall!(void)(_classBinding.setFocusNext, _godot_object, next); 1338 } 1339 /** 1340 1341 */ 1342 NodePath getFocusNext() const 1343 { 1344 checkClassBinding!(typeof(this))(); 1345 return ptrcall!(NodePath)(_classBinding.getFocusNext, _godot_object); 1346 } 1347 /** 1348 1349 */ 1350 void setFocusPrevious(NodePathArg0)(in NodePathArg0 previous) 1351 { 1352 checkClassBinding!(typeof(this))(); 1353 ptrcall!(void)(_classBinding.setFocusPrevious, _godot_object, previous); 1354 } 1355 /** 1356 1357 */ 1358 NodePath getFocusPrevious() const 1359 { 1360 checkClassBinding!(typeof(this))(); 1361 return ptrcall!(NodePath)(_classBinding.getFocusPrevious, _godot_object); 1362 } 1363 /** 1364 Forces drag and bypasses $(D getDragData) and $(D setDragPreview) by passing `data` and `preview`. Drag will start even if the mouse is neither over nor pressed on this control. 1365 The methods $(D canDropData) and $(D dropData) must be implemented on controls that want to receive drop data. 1366 */ 1367 void forceDrag(VariantArg0)(in VariantArg0 data, GodotObject preview) 1368 { 1369 checkClassBinding!(typeof(this))(); 1370 ptrcall!(void)(_classBinding.forceDrag, _godot_object, data, preview); 1371 } 1372 /** 1373 1374 */ 1375 void setMouseFilter(in long filter) 1376 { 1377 checkClassBinding!(typeof(this))(); 1378 ptrcall!(void)(_classBinding.setMouseFilter, _godot_object, filter); 1379 } 1380 /** 1381 1382 */ 1383 Control.MouseFilter getMouseFilter() const 1384 { 1385 checkClassBinding!(typeof(this))(); 1386 return ptrcall!(Control.MouseFilter)(_classBinding.getMouseFilter, _godot_object); 1387 } 1388 /** 1389 1390 */ 1391 void setClipContents(in bool enable) 1392 { 1393 checkClassBinding!(typeof(this))(); 1394 ptrcall!(void)(_classBinding.setClipContents, _godot_object, enable); 1395 } 1396 /** 1397 1398 */ 1399 bool isClippingContents() 1400 { 1401 checkClassBinding!(typeof(this))(); 1402 return ptrcall!(bool)(_classBinding.isClippingContents, _godot_object); 1403 } 1404 /** 1405 1406 */ 1407 void grabClickFocus() 1408 { 1409 checkClassBinding!(typeof(this))(); 1410 ptrcall!(void)(_classBinding.grabClickFocus, _godot_object); 1411 } 1412 /** 1413 Forwards the handling of this control's drag and drop to `target` control. 1414 Forwarding can be implemented in the target control similar to the methods $(D getDragData), $(D canDropData), and $(D dropData) but with two differences: 1415 1. The function name must be suffixed with $(B _fw) 1416 2. The function must take an extra argument that is the control doing the forwarding 1417 1418 1419 # ThisControl.gd 1420 extends Control 1421 func _ready(): 1422 set_drag_forwarding(target_control) 1423 1424 # TargetControl.gd 1425 extends Control 1426 func can_drop_data_fw(position, data, from_control): 1427 return true 1428 1429 func drop_data_fw(position, data, from_control): 1430 my_handle_data(data) 1431 1432 func get_drag_data_fw(position, from_control): 1433 set_drag_preview(my_preview) 1434 return my_data() 1435 1436 1437 */ 1438 void setDragForwarding(GodotObject target) 1439 { 1440 checkClassBinding!(typeof(this))(); 1441 ptrcall!(void)(_classBinding.setDragForwarding, _godot_object, target); 1442 } 1443 /** 1444 Shows the given control at the mouse pointer. A good time to call this method is in $(D getDragData). 1445 */ 1446 void setDragPreview(GodotObject control) 1447 { 1448 checkClassBinding!(typeof(this))(); 1449 ptrcall!(void)(_classBinding.setDragPreview, _godot_object, control); 1450 } 1451 /** 1452 1453 */ 1454 void warpMouse(in Vector2 to_position) 1455 { 1456 checkClassBinding!(typeof(this))(); 1457 ptrcall!(void)(_classBinding.warpMouse, _godot_object, to_position); 1458 } 1459 /** 1460 1461 */ 1462 void minimumSizeChanged() 1463 { 1464 checkClassBinding!(typeof(this))(); 1465 ptrcall!(void)(_classBinding.minimumSizeChanged, _godot_object); 1466 } 1467 /** 1468 1469 */ 1470 void _themeChanged() 1471 { 1472 Array _GODOT_args = Array.empty_array; 1473 String _GODOT_method_name = String("_theme_changed"); 1474 this.callv(_GODOT_method_name, _GODOT_args); 1475 } 1476 /** 1477 1478 */ 1479 void _fontChanged() 1480 { 1481 Array _GODOT_args = Array.empty_array; 1482 String _GODOT_method_name = String("_font_changed"); 1483 this.callv(_GODOT_method_name, _GODOT_args); 1484 } 1485 /** 1486 Anchors the left edge of the node to the origin, the center or the end of its parent container. It changes how the left margin updates when the node moves or changes size. Use one of the `ANCHOR_*` constants. Default value: `ANCHOR_BEGIN`. 1487 */ 1488 @property double anchorLeft() 1489 { 1490 return getAnchor(0); 1491 } 1492 /// ditto 1493 @property void anchorLeft(double v) 1494 { 1495 _setAnchor(0, v); 1496 } 1497 /** 1498 Anchors the top edge of the node to the origin, the center or the end of its parent container. It changes how the top margin updates when the node moves or changes size. Use one of the `ANCHOR_*` constants. Default value: `ANCHOR_BEGIN`. 1499 */ 1500 @property double anchorTop() 1501 { 1502 return getAnchor(1); 1503 } 1504 /// ditto 1505 @property void anchorTop(double v) 1506 { 1507 _setAnchor(1, v); 1508 } 1509 /** 1510 Anchors the right edge of the node to the origin, the center or the end of its parent container. It changes how the right margin updates when the node moves or changes size. Use one of the `ANCHOR_*` constants. Default value: `ANCHOR_BEGIN`. 1511 */ 1512 @property double anchorRight() 1513 { 1514 return getAnchor(2); 1515 } 1516 /// ditto 1517 @property void anchorRight(double v) 1518 { 1519 _setAnchor(2, v); 1520 } 1521 /** 1522 Anchors the bottom edge of the node to the origin, the center, or the end of its parent container. It changes how the bottom margin updates when the node moves or changes size. Use one of the `ANCHOR_*` constants. Default value: `ANCHOR_BEGIN`. 1523 */ 1524 @property double anchorBottom() 1525 { 1526 return getAnchor(3); 1527 } 1528 /// ditto 1529 @property void anchorBottom(double v) 1530 { 1531 _setAnchor(3, v); 1532 } 1533 /** 1534 Distance between the node's left edge and its parent container, based on $(D anchorLeft). 1535 */ 1536 @property double marginLeft() 1537 { 1538 return getMargin(0); 1539 } 1540 /// ditto 1541 @property void marginLeft(double v) 1542 { 1543 setMargin(0, v); 1544 } 1545 /** 1546 Distance between the node's top edge and its parent container, based on $(D anchorTop). 1547 */ 1548 @property double marginTop() 1549 { 1550 return getMargin(1); 1551 } 1552 /// ditto 1553 @property void marginTop(double v) 1554 { 1555 setMargin(1, v); 1556 } 1557 /** 1558 Distance between the node's right edge and its parent container, based on $(D anchorRight). 1559 */ 1560 @property double marginRight() 1561 { 1562 return getMargin(2); 1563 } 1564 /// ditto 1565 @property void marginRight(double v) 1566 { 1567 setMargin(2, v); 1568 } 1569 /** 1570 Distance between the node's bottom edge and its parent container, based on $(D anchorBottom). 1571 Margins are often controlled by one or multiple parent $(D Container) nodes. Margins update automatically when you move or resize the node. 1572 */ 1573 @property double marginBottom() 1574 { 1575 return getMargin(3); 1576 } 1577 /// ditto 1578 @property void marginBottom(double v) 1579 { 1580 setMargin(3, v); 1581 } 1582 /** 1583 1584 */ 1585 @property Control.GrowDirection growHorizontal() 1586 { 1587 return getHGrowDirection(); 1588 } 1589 /// ditto 1590 @property void growHorizontal(long v) 1591 { 1592 setHGrowDirection(v); 1593 } 1594 /** 1595 1596 */ 1597 @property Control.GrowDirection growVertical() 1598 { 1599 return getVGrowDirection(); 1600 } 1601 /// ditto 1602 @property void growVertical(long v) 1603 { 1604 setVGrowDirection(v); 1605 } 1606 /** 1607 The node's position, relative to its parent. It corresponds to the rectangle's top-left corner. The property is not affected by $(D rectPivotOffset). 1608 */ 1609 @property Vector2 rectPosition() 1610 { 1611 return getPosition(); 1612 } 1613 /// ditto 1614 @property void rectPosition(Vector2 v) 1615 { 1616 setPosition(v); 1617 } 1618 /** 1619 The node's global position, relative to the world (usually to the top-left corner of the window). 1620 */ 1621 @property Vector2 rectGlobalPosition() 1622 { 1623 return getGlobalPosition(); 1624 } 1625 /// ditto 1626 @property void rectGlobalPosition(Vector2 v) 1627 { 1628 setGlobalPosition(v); 1629 } 1630 /** 1631 The size of the node's bounding rectangle, in pixels. $(D Container) nodes update this property automatically. 1632 */ 1633 @property Vector2 rectSize() 1634 { 1635 return getSize(); 1636 } 1637 /// ditto 1638 @property void rectSize(Vector2 v) 1639 { 1640 setSize(v); 1641 } 1642 /** 1643 The minimum size of the node's bounding rectangle. If you set it to a value greater than (0, 0), the node's bounding rectangle will always have at least this size, even if its content is smaller. If it's set to (0, 0), the node sizes automatically to fit its content, be it a texture or child nodes. 1644 */ 1645 @property Vector2 rectMinSize() 1646 { 1647 return getCustomMinimumSize(); 1648 } 1649 /// ditto 1650 @property void rectMinSize(Vector2 v) 1651 { 1652 setCustomMinimumSize(v); 1653 } 1654 /** 1655 The node's rotation around its pivot, in degrees. See $(D rectPivotOffset) to change the pivot's position. 1656 */ 1657 @property double rectRotation() 1658 { 1659 return getRotationDegrees(); 1660 } 1661 /// ditto 1662 @property void rectRotation(double v) 1663 { 1664 setRotationDegrees(v); 1665 } 1666 /** 1667 The node's scale, relative to its $(D rectSize). Change this property to scale the node around its $(D rectPivotOffset). 1668 */ 1669 @property Vector2 rectScale() 1670 { 1671 return getScale(); 1672 } 1673 /// ditto 1674 @property void rectScale(Vector2 v) 1675 { 1676 setScale(v); 1677 } 1678 /** 1679 By default, the node's pivot is its top-left corner. When you change its $(D rectScale), it will scale around this pivot. Set this property to $(D rectSize) / 2 to center the pivot in the node's rectangle. 1680 */ 1681 @property Vector2 rectPivotOffset() 1682 { 1683 return getPivotOffset(); 1684 } 1685 /// ditto 1686 @property void rectPivotOffset(Vector2 v) 1687 { 1688 setPivotOffset(v); 1689 } 1690 /** 1691 1692 */ 1693 @property bool rectClipContent() 1694 { 1695 return isClippingContents(); 1696 } 1697 /// ditto 1698 @property void rectClipContent(bool v) 1699 { 1700 setClipContents(v); 1701 } 1702 /** 1703 Changes the tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments. 1704 */ 1705 @property String hintTooltip() 1706 { 1707 return _getTooltip(); 1708 } 1709 /// ditto 1710 @property void hintTooltip(String v) 1711 { 1712 setTooltip(v); 1713 } 1714 /** 1715 Tells Godot which node it should give keyboard focus to if the user presses Shift+Tab, the left arrow on the keyboard or left on a gamepad. The node must be a `Control`. If this property is not set, Godot will give focus to the closest `Control` to the left of this one. 1716 */ 1717 @property NodePath focusNeighbourLeft() 1718 { 1719 return getFocusNeighbour(0); 1720 } 1721 /// ditto 1722 @property void focusNeighbourLeft(NodePath v) 1723 { 1724 setFocusNeighbour(0, v); 1725 } 1726 /** 1727 Tells Godot which node it should give keyboard focus to if the user presses Shift+Tab, the top arrow on the keyboard or top on a gamepad. The node must be a `Control`. If this property is not set, Godot will give focus to the closest `Control` to the bottom of this one. 1728 */ 1729 @property NodePath focusNeighbourTop() 1730 { 1731 return getFocusNeighbour(1); 1732 } 1733 /// ditto 1734 @property void focusNeighbourTop(NodePath v) 1735 { 1736 setFocusNeighbour(1, v); 1737 } 1738 /** 1739 Tells Godot which node it should give keyboard focus to if the user presses Tab, the right arrow on the keyboard or right on a gamepad. The node must be a `Control`. If this property is not set, Godot will give focus to the closest `Control` to the bottom of this one. 1740 */ 1741 @property NodePath focusNeighbourRight() 1742 { 1743 return getFocusNeighbour(2); 1744 } 1745 /// ditto 1746 @property void focusNeighbourRight(NodePath v) 1747 { 1748 setFocusNeighbour(2, v); 1749 } 1750 /** 1751 Tells Godot which node it should give keyboard focus to if the user presses Tab, the down arrow on the keyboard, or down on a gamepad. The node must be a `Control`. If this property is not set, Godot will give focus to the closest `Control` to the bottom of this one. 1752 If the user presses Tab, Godot will give focus to the closest node to the right first, then to the bottom. If the user presses Shift+Tab, Godot will look to the left of the node, then above it. 1753 */ 1754 @property NodePath focusNeighbourBottom() 1755 { 1756 return getFocusNeighbour(3); 1757 } 1758 /// ditto 1759 @property void focusNeighbourBottom(NodePath v) 1760 { 1761 setFocusNeighbour(3, v); 1762 } 1763 /** 1764 1765 */ 1766 @property NodePath focusNext() 1767 { 1768 return getFocusNext(); 1769 } 1770 /// ditto 1771 @property void focusNext(NodePath v) 1772 { 1773 setFocusNext(v); 1774 } 1775 /** 1776 1777 */ 1778 @property NodePath focusPrevious() 1779 { 1780 return getFocusPrevious(); 1781 } 1782 /// ditto 1783 @property void focusPrevious(NodePath v) 1784 { 1785 setFocusPrevious(v); 1786 } 1787 /** 1788 The focus access mode for the control (None, Click or All). Only one Control can be focused at the same time, and it will receive keyboard signals. 1789 */ 1790 @property Control.FocusMode focusMode() 1791 { 1792 return getFocusMode(); 1793 } 1794 /// ditto 1795 @property void focusMode(long v) 1796 { 1797 setFocusMode(v); 1798 } 1799 /** 1800 Controls whether the control will be able to receive mouse button input events through $(D _guiInput) and how these events should be handled. Use one of the `MOUSE_FILTER_*` constants. See the constants to learn what each does. 1801 */ 1802 @property Control.MouseFilter mouseFilter() 1803 { 1804 return getMouseFilter(); 1805 } 1806 /// ditto 1807 @property void mouseFilter(long v) 1808 { 1809 setMouseFilter(v); 1810 } 1811 /** 1812 The default cursor shape for this control. Useful for Godot plugins and applications or games that use the system's mouse cursors. 1813 $(B Note:) On Linux, shapes may vary depending on the cursor theme of the system. 1814 */ 1815 @property Control.CursorShape mouseDefaultCursorShape() 1816 { 1817 return getDefaultCursorShape(); 1818 } 1819 /// ditto 1820 @property void mouseDefaultCursorShape(long v) 1821 { 1822 setDefaultCursorShape(v); 1823 } 1824 /** 1825 Tells the parent $(D Container) nodes how they should resize and place the node on the X axis. Use one of the `SIZE_*` constants to change the flags. See the constants to learn what each does. 1826 */ 1827 @property long sizeFlagsHorizontal() 1828 { 1829 return getHSizeFlags(); 1830 } 1831 /// ditto 1832 @property void sizeFlagsHorizontal(long v) 1833 { 1834 setHSizeFlags(v); 1835 } 1836 /** 1837 Tells the parent $(D Container) nodes how they should resize and place the node on the Y axis. Use one of the `SIZE_*` constants to change the flags. See the constants to learn what each does. 1838 */ 1839 @property long sizeFlagsVertical() 1840 { 1841 return getVSizeFlags(); 1842 } 1843 /// ditto 1844 @property void sizeFlagsVertical(long v) 1845 { 1846 setVSizeFlags(v); 1847 } 1848 /** 1849 If the node and at least one of its neighbours uses the `SIZE_EXPAND` size flag, the parent $(D Container) will let it take more or less space depending on this property. If this node has a stretch ratio of 2 and its neighbour a ratio of 1, this node will take two thirds of the available space. 1850 */ 1851 @property double sizeFlagsStretchRatio() 1852 { 1853 return getStretchRatio(); 1854 } 1855 /// ditto 1856 @property void sizeFlagsStretchRatio(double v) 1857 { 1858 setStretchRatio(v); 1859 } 1860 /** 1861 Changing this property replaces the current $(D Theme) resource this node and all its `Control` children use. 1862 */ 1863 @property Theme theme() 1864 { 1865 return getTheme(); 1866 } 1867 /// ditto 1868 @property void theme(Theme v) 1869 { 1870 setTheme(v); 1871 } 1872 }