1 /** 2 SceneTree manages a hierarchy of nodes. 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.scenetree; 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.mainloop; 24 import godot.viewport; 25 import godot.node; 26 import godot.scenetreetimer; 27 import godot.packedscene; 28 import godot.multiplayerapi; 29 import godot.networkedmultiplayerpeer; 30 /** 31 SceneTree manages a hierarchy of nodes. 32 33 As one of the most important classes, the `SceneTree` manages the hierarchy of nodes in a scene as well as scenes themselves. Nodes can be added, retrieved and removed. The whole scene tree (and thus the current scene) can be paused. Scenes can be loaded, switched and reloaded. You can also use the SceneTree to organize your nodes into groups: every node can be assigned as many groups as you want to create, e.g. a "enemy" group. You can then iterate these groups or even call methods and set properties on all the group's members at once. 34 */ 35 @GodotBaseClass struct SceneTree 36 { 37 enum string _GODOT_internal_name = "SceneTree"; 38 public: 39 @nogc nothrow: 40 union { godot_object _godot_object; MainLoop _GODOT_base; } 41 alias _GODOT_base this; 42 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 43 package(godot) __gshared bool _classBindingInitialized = false; 44 package(godot) static struct _classBinding 45 { 46 __gshared: 47 @GodotName("get_root") GodotMethod!(Viewport) getRoot; 48 @GodotName("has_group") GodotMethod!(bool, String) hasGroup; 49 @GodotName("set_auto_accept_quit") GodotMethod!(void, bool) setAutoAcceptQuit; 50 @GodotName("set_quit_on_go_back") GodotMethod!(void, bool) setQuitOnGoBack; 51 @GodotName("set_debug_collisions_hint") GodotMethod!(void, bool) setDebugCollisionsHint; 52 @GodotName("is_debugging_collisions_hint") GodotMethod!(bool) isDebuggingCollisionsHint; 53 @GodotName("set_debug_navigation_hint") GodotMethod!(void, bool) setDebugNavigationHint; 54 @GodotName("is_debugging_navigation_hint") GodotMethod!(bool) isDebuggingNavigationHint; 55 @GodotName("set_edited_scene_root") GodotMethod!(void, GodotObject) setEditedSceneRoot; 56 @GodotName("get_edited_scene_root") GodotMethod!(Node) getEditedSceneRoot; 57 @GodotName("set_pause") GodotMethod!(void, bool) setPause; 58 @GodotName("is_paused") GodotMethod!(bool) isPaused; 59 @GodotName("set_input_as_handled") GodotMethod!(void) setInputAsHandled; 60 @GodotName("is_input_handled") GodotMethod!(bool) isInputHandled; 61 @GodotName("create_timer") GodotMethod!(SceneTreeTimer, double, bool) createTimer; 62 @GodotName("get_node_count") GodotMethod!(long) getNodeCount; 63 @GodotName("get_frame") GodotMethod!(long) getFrame; 64 @GodotName("quit") GodotMethod!(void) quit; 65 @GodotName("set_screen_stretch") GodotMethod!(void, long, long, Vector2, double) setScreenStretch; 66 @GodotName("queue_delete") GodotMethod!(void, GodotObject) queueDelete; 67 @GodotName("call_group_flags") GodotMethod!(Variant, long, String, String, GodotVarArgs) callGroupFlags; 68 @GodotName("notify_group_flags") GodotMethod!(void, long, String, long) notifyGroupFlags; 69 @GodotName("set_group_flags") GodotMethod!(void, long, String, String, Variant) setGroupFlags; 70 @GodotName("call_group") GodotMethod!(Variant, String, String, GodotVarArgs) callGroup; 71 @GodotName("notify_group") GodotMethod!(void, String, long) notifyGroup; 72 @GodotName("set_group") GodotMethod!(void, String, String, Variant) setGroup; 73 @GodotName("get_nodes_in_group") GodotMethod!(Array, String) getNodesInGroup; 74 @GodotName("set_current_scene") GodotMethod!(void, GodotObject) setCurrentScene; 75 @GodotName("get_current_scene") GodotMethod!(Node) getCurrentScene; 76 @GodotName("change_scene") GodotMethod!(GodotError, String) changeScene; 77 @GodotName("change_scene_to") GodotMethod!(GodotError, PackedScene) changeSceneTo; 78 @GodotName("reload_current_scene") GodotMethod!(GodotError) reloadCurrentScene; 79 @GodotName("_change_scene") GodotMethod!(void, GodotObject) _changeScene; 80 @GodotName("set_multiplayer") GodotMethod!(void, MultiplayerAPI) setMultiplayer; 81 @GodotName("get_multiplayer") GodotMethod!(MultiplayerAPI) getMultiplayer; 82 @GodotName("set_multiplayer_poll_enabled") GodotMethod!(void, bool) setMultiplayerPollEnabled; 83 @GodotName("is_multiplayer_poll_enabled") GodotMethod!(bool) isMultiplayerPollEnabled; 84 @GodotName("set_network_peer") GodotMethod!(void, NetworkedMultiplayerPeer) setNetworkPeer; 85 @GodotName("get_network_peer") GodotMethod!(NetworkedMultiplayerPeer) getNetworkPeer; 86 @GodotName("is_network_server") GodotMethod!(bool) isNetworkServer; 87 @GodotName("has_network_peer") GodotMethod!(bool) hasNetworkPeer; 88 @GodotName("get_network_connected_peers") GodotMethod!(PoolIntArray) getNetworkConnectedPeers; 89 @GodotName("get_network_unique_id") GodotMethod!(long) getNetworkUniqueId; 90 @GodotName("get_rpc_sender_id") GodotMethod!(long) getRpcSenderId; 91 @GodotName("set_refuse_new_network_connections") GodotMethod!(void, bool) setRefuseNewNetworkConnections; 92 @GodotName("is_refusing_new_network_connections") GodotMethod!(bool) isRefusingNewNetworkConnections; 93 @GodotName("_network_peer_connected") GodotMethod!(void, long) _networkPeerConnected; 94 @GodotName("_network_peer_disconnected") GodotMethod!(void, long) _networkPeerDisconnected; 95 @GodotName("_connected_to_server") GodotMethod!(void) _connectedToServer; 96 @GodotName("_connection_failed") GodotMethod!(void) _connectionFailed; 97 @GodotName("_server_disconnected") GodotMethod!(void) _serverDisconnected; 98 @GodotName("set_use_font_oversampling") GodotMethod!(void, bool) setUseFontOversampling; 99 @GodotName("is_using_font_oversampling") GodotMethod!(bool) isUsingFontOversampling; 100 } 101 bool opEquals(in SceneTree other) const { return _godot_object.ptr is other._godot_object.ptr; } 102 SceneTree opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 103 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 104 mixin baseCasts; 105 static SceneTree _new() 106 { 107 static godot_class_constructor constructor; 108 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("SceneTree"); 109 if(constructor is null) return typeof(this).init; 110 return cast(SceneTree)(constructor()); 111 } 112 @disable new(size_t s); 113 /// 114 enum StretchAspect : int 115 { 116 /** 117 Fill the window with the content stretched to cover excessive space. Content may appear elongated. 118 */ 119 stretchAspectIgnore = 0, 120 /** 121 Retain the same aspect ratio by padding with black bars in either axes. No expansion of content. 122 */ 123 stretchAspectKeep = 1, 124 /** 125 Expand vertically. Left/right black bars may appear if the window is too wide. 126 */ 127 stretchAspectKeepWidth = 2, 128 /** 129 Expand horizontally. Top/bottom black bars may appear if the window is too tall. 130 */ 131 stretchAspectKeepHeight = 3, 132 /** 133 Expand in both directions, retaining the same aspect ratio. No black bars. 134 */ 135 stretchAspectExpand = 4, 136 } 137 /// 138 enum GroupCallFlags : int 139 { 140 /** 141 Call a group with no flags (default). 142 */ 143 groupCallDefault = 0, 144 /** 145 Call a group in reverse scene order. 146 */ 147 groupCallReverse = 1, 148 /** 149 Call a group immediately (calls are normally made on idle). 150 */ 151 groupCallRealtime = 2, 152 /** 153 Call a group only once even if the call is executed many times. 154 */ 155 groupCallUnique = 4, 156 } 157 /// 158 enum StretchMode : int 159 { 160 /** 161 No stretching. 162 */ 163 stretchModeDisabled = 0, 164 /** 165 Render stretching in higher resolution (interpolated). 166 */ 167 stretchMode2d = 1, 168 /** 169 Keep the specified display resolution. No interpolation. Content may appear pixelated. 170 */ 171 stretchModeViewport = 2, 172 } 173 /// 174 enum Constants : int 175 { 176 groupCallDefault = 0, 177 stretchModeDisabled = 0, 178 stretchAspectIgnore = 0, 179 stretchMode2d = 1, 180 stretchAspectKeep = 1, 181 groupCallReverse = 1, 182 stretchModeViewport = 2, 183 groupCallRealtime = 2, 184 stretchAspectKeepWidth = 2, 185 stretchAspectKeepHeight = 3, 186 groupCallUnique = 4, 187 stretchAspectExpand = 4, 188 } 189 /** 190 191 */ 192 Viewport getRoot() const 193 { 194 checkClassBinding!(typeof(this))(); 195 return ptrcall!(Viewport)(_classBinding.getRoot, _godot_object); 196 } 197 /** 198 Returns `true` if the given group exists. 199 */ 200 bool hasGroup(StringArg0)(in StringArg0 name) const 201 { 202 checkClassBinding!(typeof(this))(); 203 return ptrcall!(bool)(_classBinding.hasGroup, _godot_object, name); 204 } 205 /** 206 If `true` the application automatically accepts quitting. 207 */ 208 void setAutoAcceptQuit(in bool enabled) 209 { 210 checkClassBinding!(typeof(this))(); 211 ptrcall!(void)(_classBinding.setAutoAcceptQuit, _godot_object, enabled); 212 } 213 /** 214 If `true` the application quits automatically on going back (e.g. on Android). 215 */ 216 void setQuitOnGoBack(in bool enabled) 217 { 218 checkClassBinding!(typeof(this))(); 219 ptrcall!(void)(_classBinding.setQuitOnGoBack, _godot_object, enabled); 220 } 221 /** 222 223 */ 224 void setDebugCollisionsHint(in bool enable) 225 { 226 checkClassBinding!(typeof(this))(); 227 ptrcall!(void)(_classBinding.setDebugCollisionsHint, _godot_object, enable); 228 } 229 /** 230 231 */ 232 bool isDebuggingCollisionsHint() const 233 { 234 checkClassBinding!(typeof(this))(); 235 return ptrcall!(bool)(_classBinding.isDebuggingCollisionsHint, _godot_object); 236 } 237 /** 238 239 */ 240 void setDebugNavigationHint(in bool enable) 241 { 242 checkClassBinding!(typeof(this))(); 243 ptrcall!(void)(_classBinding.setDebugNavigationHint, _godot_object, enable); 244 } 245 /** 246 247 */ 248 bool isDebuggingNavigationHint() const 249 { 250 checkClassBinding!(typeof(this))(); 251 return ptrcall!(bool)(_classBinding.isDebuggingNavigationHint, _godot_object); 252 } 253 /** 254 255 */ 256 void setEditedSceneRoot(GodotObject scene) 257 { 258 checkClassBinding!(typeof(this))(); 259 ptrcall!(void)(_classBinding.setEditedSceneRoot, _godot_object, scene); 260 } 261 /** 262 263 */ 264 Node getEditedSceneRoot() const 265 { 266 checkClassBinding!(typeof(this))(); 267 return ptrcall!(Node)(_classBinding.getEditedSceneRoot, _godot_object); 268 } 269 /** 270 271 */ 272 void setPause(in bool enable) 273 { 274 checkClassBinding!(typeof(this))(); 275 ptrcall!(void)(_classBinding.setPause, _godot_object, enable); 276 } 277 /** 278 279 */ 280 bool isPaused() const 281 { 282 checkClassBinding!(typeof(this))(); 283 return ptrcall!(bool)(_classBinding.isPaused, _godot_object); 284 } 285 /** 286 Marks the most recent input event as handled. 287 */ 288 void setInputAsHandled() 289 { 290 checkClassBinding!(typeof(this))(); 291 ptrcall!(void)(_classBinding.setInputAsHandled, _godot_object); 292 } 293 /** 294 Returns `true` if the most recent InputEvent was marked as handled with $(D setInputAsHandled). 295 */ 296 bool isInputHandled() 297 { 298 checkClassBinding!(typeof(this))(); 299 return ptrcall!(bool)(_classBinding.isInputHandled, _godot_object); 300 } 301 /** 302 Returns a $(D SceneTreeTimer) which will $(D SceneTreeTimer.timeout) after the given time in seconds elapsed in this SceneTree. If `pause_mode_process` is set to false, pausing the SceneTree will also pause the timer. 303 */ 304 Ref!SceneTreeTimer createTimer(in double time_sec, in bool pause_mode_process = true) 305 { 306 checkClassBinding!(typeof(this))(); 307 return ptrcall!(SceneTreeTimer)(_classBinding.createTimer, _godot_object, time_sec, pause_mode_process); 308 } 309 /** 310 Returns the number of nodes in this SceneTree. 311 */ 312 long getNodeCount() const 313 { 314 checkClassBinding!(typeof(this))(); 315 return ptrcall!(long)(_classBinding.getNodeCount, _godot_object); 316 } 317 /** 318 319 */ 320 long getFrame() const 321 { 322 checkClassBinding!(typeof(this))(); 323 return ptrcall!(long)(_classBinding.getFrame, _godot_object); 324 } 325 /** 326 Quits the application. 327 */ 328 void quit() 329 { 330 checkClassBinding!(typeof(this))(); 331 ptrcall!(void)(_classBinding.quit, _godot_object); 332 } 333 /** 334 Configures screen stretching to the given $(D stretchmode), $(D stretchaspect), minimum size and `shrink`. 335 */ 336 void setScreenStretch(in long mode, in long aspect, in Vector2 minsize, in double shrink = 1) 337 { 338 checkClassBinding!(typeof(this))(); 339 ptrcall!(void)(_classBinding.setScreenStretch, _godot_object, mode, aspect, minsize, shrink); 340 } 341 /** 342 Queues the given object for deletion, delaying the call to $(D GodotObject.free) to after the current frame. 343 */ 344 void queueDelete(GodotObject obj) 345 { 346 checkClassBinding!(typeof(this))(); 347 ptrcall!(void)(_classBinding.queueDelete, _godot_object, obj); 348 } 349 /** 350 Calls `method` on each member of the given group, respecting the given $(D groupcallflags). 351 */ 352 Variant callGroupFlags(StringArg1, StringArg2, VarArgs...)(in long flags, in StringArg1 group, in StringArg2 method, VarArgs varArgs) 353 { 354 Array _GODOT_args = Array.empty_array; 355 _GODOT_args.append(flags); 356 _GODOT_args.append(group); 357 _GODOT_args.append(method); 358 foreach(vai, VA; VarArgs) 359 { 360 _GODOT_args.append(varArgs[vai]); 361 } 362 String _GODOT_method_name = String("call_group_flags"); 363 return this.callv(_GODOT_method_name, _GODOT_args); 364 } 365 /** 366 Sends the given notification to all members of the `group`, respecting the given $(D groupcallflags). 367 */ 368 void notifyGroupFlags(StringArg1)(in long call_flags, in StringArg1 group, in long notification) 369 { 370 checkClassBinding!(typeof(this))(); 371 ptrcall!(void)(_classBinding.notifyGroupFlags, _godot_object, call_flags, group, notification); 372 } 373 /** 374 Sets the given `property` to `value` on all members of the given group, respecting the given $(D groupcallflags). 375 */ 376 void setGroupFlags(StringArg1, StringArg2, VariantArg3)(in long call_flags, in StringArg1 group, in StringArg2 property, in VariantArg3 value) 377 { 378 checkClassBinding!(typeof(this))(); 379 ptrcall!(void)(_classBinding.setGroupFlags, _godot_object, call_flags, group, property, value); 380 } 381 /** 382 Calls `method` on each member of the given group. 383 */ 384 Variant callGroup(StringArg0, StringArg1, VarArgs...)(in StringArg0 group, in StringArg1 method, VarArgs varArgs) 385 { 386 Array _GODOT_args = Array.empty_array; 387 _GODOT_args.append(group); 388 _GODOT_args.append(method); 389 foreach(vai, VA; VarArgs) 390 { 391 _GODOT_args.append(varArgs[vai]); 392 } 393 String _GODOT_method_name = String("call_group"); 394 return this.callv(_GODOT_method_name, _GODOT_args); 395 } 396 /** 397 Sends the given notification to all members of the `group`. 398 */ 399 void notifyGroup(StringArg0)(in StringArg0 group, in long notification) 400 { 401 checkClassBinding!(typeof(this))(); 402 ptrcall!(void)(_classBinding.notifyGroup, _godot_object, group, notification); 403 } 404 /** 405 Sets the given `property` to `value` on all members of the given group. 406 */ 407 void setGroup(StringArg0, StringArg1, VariantArg2)(in StringArg0 group, in StringArg1 property, in VariantArg2 value) 408 { 409 checkClassBinding!(typeof(this))(); 410 ptrcall!(void)(_classBinding.setGroup, _godot_object, group, property, value); 411 } 412 /** 413 Returns all nodes assigned to the given group. 414 */ 415 Array getNodesInGroup(StringArg0)(in StringArg0 group) 416 { 417 checkClassBinding!(typeof(this))(); 418 return ptrcall!(Array)(_classBinding.getNodesInGroup, _godot_object, group); 419 } 420 /** 421 422 */ 423 void setCurrentScene(GodotObject child_node) 424 { 425 checkClassBinding!(typeof(this))(); 426 ptrcall!(void)(_classBinding.setCurrentScene, _godot_object, child_node); 427 } 428 /** 429 430 */ 431 Node getCurrentScene() const 432 { 433 checkClassBinding!(typeof(this))(); 434 return ptrcall!(Node)(_classBinding.getCurrentScene, _godot_object); 435 } 436 /** 437 Changes to the scene at the given `path`. 438 */ 439 GodotError changeScene(StringArg0)(in StringArg0 path) 440 { 441 checkClassBinding!(typeof(this))(); 442 return ptrcall!(GodotError)(_classBinding.changeScene, _godot_object, path); 443 } 444 /** 445 Changes to the given $(D PackedScene). 446 */ 447 GodotError changeSceneTo(PackedScene packed_scene) 448 { 449 checkClassBinding!(typeof(this))(); 450 return ptrcall!(GodotError)(_classBinding.changeSceneTo, _godot_object, packed_scene); 451 } 452 /** 453 Reloads the currently active scene. 454 */ 455 GodotError reloadCurrentScene() 456 { 457 checkClassBinding!(typeof(this))(); 458 return ptrcall!(GodotError)(_classBinding.reloadCurrentScene, _godot_object); 459 } 460 /** 461 462 */ 463 void _changeScene(GodotObject arg0) 464 { 465 Array _GODOT_args = Array.empty_array; 466 _GODOT_args.append(arg0); 467 String _GODOT_method_name = String("_change_scene"); 468 this.callv(_GODOT_method_name, _GODOT_args); 469 } 470 /** 471 472 */ 473 void setMultiplayer(MultiplayerAPI multiplayer) 474 { 475 checkClassBinding!(typeof(this))(); 476 ptrcall!(void)(_classBinding.setMultiplayer, _godot_object, multiplayer); 477 } 478 /** 479 480 */ 481 Ref!MultiplayerAPI getMultiplayer() const 482 { 483 checkClassBinding!(typeof(this))(); 484 return ptrcall!(MultiplayerAPI)(_classBinding.getMultiplayer, _godot_object); 485 } 486 /** 487 488 */ 489 void setMultiplayerPollEnabled(in bool enabled) 490 { 491 checkClassBinding!(typeof(this))(); 492 ptrcall!(void)(_classBinding.setMultiplayerPollEnabled, _godot_object, enabled); 493 } 494 /** 495 496 */ 497 bool isMultiplayerPollEnabled() const 498 { 499 checkClassBinding!(typeof(this))(); 500 return ptrcall!(bool)(_classBinding.isMultiplayerPollEnabled, _godot_object); 501 } 502 /** 503 504 */ 505 void setNetworkPeer(NetworkedMultiplayerPeer peer) 506 { 507 checkClassBinding!(typeof(this))(); 508 ptrcall!(void)(_classBinding.setNetworkPeer, _godot_object, peer); 509 } 510 /** 511 512 */ 513 Ref!NetworkedMultiplayerPeer getNetworkPeer() const 514 { 515 checkClassBinding!(typeof(this))(); 516 return ptrcall!(NetworkedMultiplayerPeer)(_classBinding.getNetworkPeer, _godot_object); 517 } 518 /** 519 Returns `true` if this SceneTree's $(D networkPeer) is in server mode (listening for connections). 520 */ 521 bool isNetworkServer() const 522 { 523 checkClassBinding!(typeof(this))(); 524 return ptrcall!(bool)(_classBinding.isNetworkServer, _godot_object); 525 } 526 /** 527 Returns `true` if there is a $(D networkPeer) set. 528 */ 529 bool hasNetworkPeer() const 530 { 531 checkClassBinding!(typeof(this))(); 532 return ptrcall!(bool)(_classBinding.hasNetworkPeer, _godot_object); 533 } 534 /** 535 Returns the peer IDs of all connected peers of this SceneTree's $(D networkPeer). 536 */ 537 PoolIntArray getNetworkConnectedPeers() const 538 { 539 checkClassBinding!(typeof(this))(); 540 return ptrcall!(PoolIntArray)(_classBinding.getNetworkConnectedPeers, _godot_object); 541 } 542 /** 543 Returns the unique peer ID of this SceneTree's $(D networkPeer). 544 */ 545 long getNetworkUniqueId() const 546 { 547 checkClassBinding!(typeof(this))(); 548 return ptrcall!(long)(_classBinding.getNetworkUniqueId, _godot_object); 549 } 550 /** 551 Returns the sender's peer ID for the most recently received RPC call. 552 */ 553 long getRpcSenderId() const 554 { 555 checkClassBinding!(typeof(this))(); 556 return ptrcall!(long)(_classBinding.getRpcSenderId, _godot_object); 557 } 558 /** 559 560 */ 561 void setRefuseNewNetworkConnections(in bool refuse) 562 { 563 checkClassBinding!(typeof(this))(); 564 ptrcall!(void)(_classBinding.setRefuseNewNetworkConnections, _godot_object, refuse); 565 } 566 /** 567 568 */ 569 bool isRefusingNewNetworkConnections() const 570 { 571 checkClassBinding!(typeof(this))(); 572 return ptrcall!(bool)(_classBinding.isRefusingNewNetworkConnections, _godot_object); 573 } 574 /** 575 576 */ 577 void _networkPeerConnected(in long arg0) 578 { 579 Array _GODOT_args = Array.empty_array; 580 _GODOT_args.append(arg0); 581 String _GODOT_method_name = String("_network_peer_connected"); 582 this.callv(_GODOT_method_name, _GODOT_args); 583 } 584 /** 585 586 */ 587 void _networkPeerDisconnected(in long arg0) 588 { 589 Array _GODOT_args = Array.empty_array; 590 _GODOT_args.append(arg0); 591 String _GODOT_method_name = String("_network_peer_disconnected"); 592 this.callv(_GODOT_method_name, _GODOT_args); 593 } 594 /** 595 596 */ 597 void _connectedToServer() 598 { 599 Array _GODOT_args = Array.empty_array; 600 String _GODOT_method_name = String("_connected_to_server"); 601 this.callv(_GODOT_method_name, _GODOT_args); 602 } 603 /** 604 605 */ 606 void _connectionFailed() 607 { 608 Array _GODOT_args = Array.empty_array; 609 String _GODOT_method_name = String("_connection_failed"); 610 this.callv(_GODOT_method_name, _GODOT_args); 611 } 612 /** 613 614 */ 615 void _serverDisconnected() 616 { 617 Array _GODOT_args = Array.empty_array; 618 String _GODOT_method_name = String("_server_disconnected"); 619 this.callv(_GODOT_method_name, _GODOT_args); 620 } 621 /** 622 623 */ 624 void setUseFontOversampling(in bool enable) 625 { 626 checkClassBinding!(typeof(this))(); 627 ptrcall!(void)(_classBinding.setUseFontOversampling, _godot_object, enable); 628 } 629 /** 630 631 */ 632 bool isUsingFontOversampling() const 633 { 634 checkClassBinding!(typeof(this))(); 635 return ptrcall!(bool)(_classBinding.isUsingFontOversampling, _godot_object); 636 } 637 /** 638 639 */ 640 @property bool debugCollisionsHint() 641 { 642 return isDebuggingCollisionsHint(); 643 } 644 /// ditto 645 @property void debugCollisionsHint(bool v) 646 { 647 setDebugCollisionsHint(v); 648 } 649 /** 650 651 */ 652 @property bool debugNavigationHint() 653 { 654 return isDebuggingNavigationHint(); 655 } 656 /// ditto 657 @property void debugNavigationHint(bool v) 658 { 659 setDebugNavigationHint(v); 660 } 661 /** 662 If `true` the SceneTree is paused. 663 Doing so will have the following behavior: 664 * 2D and 3D physics will be stopped. 665 * _process and _physics_process will not be called anymore in nodes. 666 * _input and _input_event will not be called anymore either. 667 */ 668 @property bool paused() 669 { 670 return isPaused(); 671 } 672 /// ditto 673 @property void paused(bool v) 674 { 675 setPause(v); 676 } 677 /** 678 If `true` the SceneTree's $(D networkPeer) refuses new incoming connections. 679 */ 680 @property bool refuseNewNetworkConnections() 681 { 682 return isRefusingNewNetworkConnections(); 683 } 684 /// ditto 685 @property void refuseNewNetworkConnections(bool v) 686 { 687 setRefuseNewNetworkConnections(v); 688 } 689 /** 690 If `true` font oversampling is used. 691 */ 692 @property bool useFontOversampling() 693 { 694 return isUsingFontOversampling(); 695 } 696 /// ditto 697 @property void useFontOversampling(bool v) 698 { 699 setUseFontOversampling(v); 700 } 701 /** 702 The root of the edited scene. 703 */ 704 @property Node editedSceneRoot() 705 { 706 return getEditedSceneRoot(); 707 } 708 /// ditto 709 @property void editedSceneRoot(GodotObject v) 710 { 711 setEditedSceneRoot(v); 712 } 713 /** 714 The current scene. 715 */ 716 @property Node currentScene() 717 { 718 return getCurrentScene(); 719 } 720 /// ditto 721 @property void currentScene(GodotObject v) 722 { 723 setCurrentScene(v); 724 } 725 /** 726 The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the SceneTree will become a network server (check with $(D isNetworkServer())) and will set root node's network mode to master (see NETWORK_MODE_* constants in $(D Node)), or it will become a regular peer with root node set to puppet. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to SceneTree's signals. 727 */ 728 @property NetworkedMultiplayerPeer networkPeer() 729 { 730 return getNetworkPeer(); 731 } 732 /// ditto 733 @property void networkPeer(NetworkedMultiplayerPeer v) 734 { 735 setNetworkPeer(v); 736 } 737 /** 738 The SceneTree's $(D Viewport). 739 */ 740 @property Viewport root() 741 { 742 return getRoot(); 743 } 744 /** 745 The default $(D MultiplayerAPI) instance for this SceneTree. 746 */ 747 @property MultiplayerAPI multiplayer() 748 { 749 return getMultiplayer(); 750 } 751 /// ditto 752 @property void multiplayer(MultiplayerAPI v) 753 { 754 setMultiplayer(v); 755 } 756 /** 757 If `true` (default) enable the automatic polling of the $(D MultiplayerAPI) for this SceneTree during $(D idleFrame). 758 When `false` you need to manually call $(D MultiplayerAPI.poll) for processing network packets and delivering RPCs/RSETs. This allows to run RPCs/RSETs in a different loop (e.g. physics, thread, specific time step) and for manual $(D Mutex) protection when accessing the $(D MultiplayerAPI) from threads. 759 */ 760 @property bool multiplayerPoll() 761 { 762 return isMultiplayerPollEnabled(); 763 } 764 /// ditto 765 @property void multiplayerPoll(bool v) 766 { 767 setMultiplayerPollEnabled(v); 768 } 769 }