1 /** 2 Camera node for 2D scenes. 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.camera2d; 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.node2d; 24 import godot.node; 25 import godot.viewport; 26 import godot.canvasitem; 27 /** 28 Camera node for 2D scenes. 29 30 It forces the screen (current layer) to scroll following this node. This makes it easier (and faster) to program scrollable scenes than manually changing the position of $(D CanvasItem) based nodes. 31 This node is intended to be a simple helper to get things going quickly and it may happen often that more functionality is desired to change how the camera works. To make your own custom camera node, simply inherit from $(D Node2D) and change the transform of the canvas by calling get_viewport().set_canvas_transform(m) in $(D Viewport). 32 */ 33 @GodotBaseClass struct Camera2D 34 { 35 enum string _GODOT_internal_name = "Camera2D"; 36 public: 37 @nogc nothrow: 38 union { godot_object _godot_object; Node2D _GODOT_base; } 39 alias _GODOT_base this; 40 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 41 package(godot) __gshared bool _classBindingInitialized = false; 42 package(godot) static struct _classBinding 43 { 44 __gshared: 45 @GodotName("set_offset") GodotMethod!(void, Vector2) setOffset; 46 @GodotName("get_offset") GodotMethod!(Vector2) getOffset; 47 @GodotName("set_anchor_mode") GodotMethod!(void, long) setAnchorMode; 48 @GodotName("get_anchor_mode") GodotMethod!(Camera2D.AnchorMode) getAnchorMode; 49 @GodotName("set_rotating") GodotMethod!(void, bool) setRotating; 50 @GodotName("is_rotating") GodotMethod!(bool) isRotating; 51 @GodotName("make_current") GodotMethod!(void) makeCurrent; 52 @GodotName("clear_current") GodotMethod!(void) clearCurrent; 53 @GodotName("_make_current") GodotMethod!(void, GodotObject) _makeCurrent; 54 @GodotName("_update_scroll") GodotMethod!(void) _updateScroll; 55 @GodotName("_set_current") GodotMethod!(void, bool) _setCurrent; 56 @GodotName("is_current") GodotMethod!(bool) isCurrent; 57 @GodotName("set_limit") GodotMethod!(void, long, long) setLimit; 58 @GodotName("get_limit") GodotMethod!(long, long) getLimit; 59 @GodotName("set_limit_smoothing_enabled") GodotMethod!(void, bool) setLimitSmoothingEnabled; 60 @GodotName("is_limit_smoothing_enabled") GodotMethod!(bool) isLimitSmoothingEnabled; 61 @GodotName("set_v_drag_enabled") GodotMethod!(void, bool) setVDragEnabled; 62 @GodotName("is_v_drag_enabled") GodotMethod!(bool) isVDragEnabled; 63 @GodotName("set_h_drag_enabled") GodotMethod!(void, bool) setHDragEnabled; 64 @GodotName("is_h_drag_enabled") GodotMethod!(bool) isHDragEnabled; 65 @GodotName("set_v_offset") GodotMethod!(void, double) setVOffset; 66 @GodotName("get_v_offset") GodotMethod!(double) getVOffset; 67 @GodotName("set_h_offset") GodotMethod!(void, double) setHOffset; 68 @GodotName("get_h_offset") GodotMethod!(double) getHOffset; 69 @GodotName("set_drag_margin") GodotMethod!(void, long, double) setDragMargin; 70 @GodotName("get_drag_margin") GodotMethod!(double, long) getDragMargin; 71 @GodotName("get_camera_position") GodotMethod!(Vector2) getCameraPosition; 72 @GodotName("get_camera_screen_center") GodotMethod!(Vector2) getCameraScreenCenter; 73 @GodotName("set_zoom") GodotMethod!(void, Vector2) setZoom; 74 @GodotName("get_zoom") GodotMethod!(Vector2) getZoom; 75 @GodotName("set_custom_viewport") GodotMethod!(void, GodotObject) setCustomViewport; 76 @GodotName("get_custom_viewport") GodotMethod!(Node) getCustomViewport; 77 @GodotName("set_follow_smoothing") GodotMethod!(void, double) setFollowSmoothing; 78 @GodotName("get_follow_smoothing") GodotMethod!(double) getFollowSmoothing; 79 @GodotName("set_enable_follow_smoothing") GodotMethod!(void, bool) setEnableFollowSmoothing; 80 @GodotName("is_follow_smoothing_enabled") GodotMethod!(bool) isFollowSmoothingEnabled; 81 @GodotName("force_update_scroll") GodotMethod!(void) forceUpdateScroll; 82 @GodotName("reset_smoothing") GodotMethod!(void) resetSmoothing; 83 @GodotName("align") GodotMethod!(void) _align; 84 @GodotName("_set_old_smoothing") GodotMethod!(void, double) _setOldSmoothing; 85 @GodotName("set_screen_drawing_enabled") GodotMethod!(void, bool) setScreenDrawingEnabled; 86 @GodotName("is_screen_drawing_enabled") GodotMethod!(bool) isScreenDrawingEnabled; 87 @GodotName("set_limit_drawing_enabled") GodotMethod!(void, bool) setLimitDrawingEnabled; 88 @GodotName("is_limit_drawing_enabled") GodotMethod!(bool) isLimitDrawingEnabled; 89 @GodotName("set_margin_drawing_enabled") GodotMethod!(void, bool) setMarginDrawingEnabled; 90 @GodotName("is_margin_drawing_enabled") GodotMethod!(bool) isMarginDrawingEnabled; 91 } 92 bool opEquals(in Camera2D other) const { return _godot_object.ptr is other._godot_object.ptr; } 93 Camera2D opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 94 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 95 mixin baseCasts; 96 static Camera2D _new() 97 { 98 static godot_class_constructor constructor; 99 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("Camera2D"); 100 if(constructor is null) return typeof(this).init; 101 return cast(Camera2D)(constructor()); 102 } 103 @disable new(size_t s); 104 /// 105 enum AnchorMode : int 106 { 107 /** 108 The camera's position is fixed so that the top-left corner is always at the origin. 109 */ 110 anchorModeFixedTopLeft = 0, 111 /** 112 The camera's position takes into account vertical/horizontal offsets and the screen size. 113 */ 114 anchorModeDragCenter = 1, 115 } 116 /// 117 enum Constants : int 118 { 119 anchorModeFixedTopLeft = 0, 120 anchorModeDragCenter = 1, 121 } 122 /** 123 124 */ 125 void setOffset(in Vector2 offset) 126 { 127 checkClassBinding!(typeof(this))(); 128 ptrcall!(void)(_classBinding.setOffset, _godot_object, offset); 129 } 130 /** 131 132 */ 133 Vector2 getOffset() const 134 { 135 checkClassBinding!(typeof(this))(); 136 return ptrcall!(Vector2)(_classBinding.getOffset, _godot_object); 137 } 138 /** 139 140 */ 141 void setAnchorMode(in long anchor_mode) 142 { 143 checkClassBinding!(typeof(this))(); 144 ptrcall!(void)(_classBinding.setAnchorMode, _godot_object, anchor_mode); 145 } 146 /** 147 148 */ 149 Camera2D.AnchorMode getAnchorMode() const 150 { 151 checkClassBinding!(typeof(this))(); 152 return ptrcall!(Camera2D.AnchorMode)(_classBinding.getAnchorMode, _godot_object); 153 } 154 /** 155 156 */ 157 void setRotating(in bool rotating) 158 { 159 checkClassBinding!(typeof(this))(); 160 ptrcall!(void)(_classBinding.setRotating, _godot_object, rotating); 161 } 162 /** 163 164 */ 165 bool isRotating() const 166 { 167 checkClassBinding!(typeof(this))(); 168 return ptrcall!(bool)(_classBinding.isRotating, _godot_object); 169 } 170 /** 171 Make this the current 2D camera for the scene (viewport and layer), in case there's many cameras in the scene. 172 */ 173 void makeCurrent() 174 { 175 checkClassBinding!(typeof(this))(); 176 ptrcall!(void)(_classBinding.makeCurrent, _godot_object); 177 } 178 /** 179 Removes any `Camera2D` from the ancestor $(D Viewport)'s internal currently-assigned camera. 180 */ 181 void clearCurrent() 182 { 183 checkClassBinding!(typeof(this))(); 184 ptrcall!(void)(_classBinding.clearCurrent, _godot_object); 185 } 186 /** 187 188 */ 189 void _makeCurrent(GodotObject arg0) 190 { 191 Array _GODOT_args = Array.empty_array; 192 _GODOT_args.append(arg0); 193 String _GODOT_method_name = String("_make_current"); 194 this.callv(_GODOT_method_name, _GODOT_args); 195 } 196 /** 197 198 */ 199 void _updateScroll() 200 { 201 Array _GODOT_args = Array.empty_array; 202 String _GODOT_method_name = String("_update_scroll"); 203 this.callv(_GODOT_method_name, _GODOT_args); 204 } 205 /** 206 207 */ 208 void _setCurrent(in bool current) 209 { 210 Array _GODOT_args = Array.empty_array; 211 _GODOT_args.append(current); 212 String _GODOT_method_name = String("_set_current"); 213 this.callv(_GODOT_method_name, _GODOT_args); 214 } 215 /** 216 217 */ 218 bool isCurrent() const 219 { 220 checkClassBinding!(typeof(this))(); 221 return ptrcall!(bool)(_classBinding.isCurrent, _godot_object); 222 } 223 /** 224 225 */ 226 void setLimit(in long margin, in long limit) 227 { 228 checkClassBinding!(typeof(this))(); 229 ptrcall!(void)(_classBinding.setLimit, _godot_object, margin, limit); 230 } 231 /** 232 233 */ 234 long getLimit(in long margin) const 235 { 236 checkClassBinding!(typeof(this))(); 237 return ptrcall!(long)(_classBinding.getLimit, _godot_object, margin); 238 } 239 /** 240 241 */ 242 void setLimitSmoothingEnabled(in bool limit_smoothing_enabled) 243 { 244 checkClassBinding!(typeof(this))(); 245 ptrcall!(void)(_classBinding.setLimitSmoothingEnabled, _godot_object, limit_smoothing_enabled); 246 } 247 /** 248 249 */ 250 bool isLimitSmoothingEnabled() const 251 { 252 checkClassBinding!(typeof(this))(); 253 return ptrcall!(bool)(_classBinding.isLimitSmoothingEnabled, _godot_object); 254 } 255 /** 256 257 */ 258 void setVDragEnabled(in bool enabled) 259 { 260 checkClassBinding!(typeof(this))(); 261 ptrcall!(void)(_classBinding.setVDragEnabled, _godot_object, enabled); 262 } 263 /** 264 265 */ 266 bool isVDragEnabled() const 267 { 268 checkClassBinding!(typeof(this))(); 269 return ptrcall!(bool)(_classBinding.isVDragEnabled, _godot_object); 270 } 271 /** 272 273 */ 274 void setHDragEnabled(in bool enabled) 275 { 276 checkClassBinding!(typeof(this))(); 277 ptrcall!(void)(_classBinding.setHDragEnabled, _godot_object, enabled); 278 } 279 /** 280 281 */ 282 bool isHDragEnabled() const 283 { 284 checkClassBinding!(typeof(this))(); 285 return ptrcall!(bool)(_classBinding.isHDragEnabled, _godot_object); 286 } 287 /** 288 289 */ 290 void setVOffset(in double ofs) 291 { 292 checkClassBinding!(typeof(this))(); 293 ptrcall!(void)(_classBinding.setVOffset, _godot_object, ofs); 294 } 295 /** 296 297 */ 298 double getVOffset() const 299 { 300 checkClassBinding!(typeof(this))(); 301 return ptrcall!(double)(_classBinding.getVOffset, _godot_object); 302 } 303 /** 304 305 */ 306 void setHOffset(in double ofs) 307 { 308 checkClassBinding!(typeof(this))(); 309 ptrcall!(void)(_classBinding.setHOffset, _godot_object, ofs); 310 } 311 /** 312 313 */ 314 double getHOffset() const 315 { 316 checkClassBinding!(typeof(this))(); 317 return ptrcall!(double)(_classBinding.getHOffset, _godot_object); 318 } 319 /** 320 321 */ 322 void setDragMargin(in long margin, in double drag_margin) 323 { 324 checkClassBinding!(typeof(this))(); 325 ptrcall!(void)(_classBinding.setDragMargin, _godot_object, margin, drag_margin); 326 } 327 /** 328 329 */ 330 double getDragMargin(in long margin) const 331 { 332 checkClassBinding!(typeof(this))(); 333 return ptrcall!(double)(_classBinding.getDragMargin, _godot_object, margin); 334 } 335 /** 336 Return the camera position. 337 */ 338 Vector2 getCameraPosition() const 339 { 340 checkClassBinding!(typeof(this))(); 341 return ptrcall!(Vector2)(_classBinding.getCameraPosition, _godot_object); 342 } 343 /** 344 Returns the location of the `Camera2D`'s screen-center, relative to the origin. 345 */ 346 Vector2 getCameraScreenCenter() const 347 { 348 checkClassBinding!(typeof(this))(); 349 return ptrcall!(Vector2)(_classBinding.getCameraScreenCenter, _godot_object); 350 } 351 /** 352 353 */ 354 void setZoom(in Vector2 zoom) 355 { 356 checkClassBinding!(typeof(this))(); 357 ptrcall!(void)(_classBinding.setZoom, _godot_object, zoom); 358 } 359 /** 360 361 */ 362 Vector2 getZoom() const 363 { 364 checkClassBinding!(typeof(this))(); 365 return ptrcall!(Vector2)(_classBinding.getZoom, _godot_object); 366 } 367 /** 368 369 */ 370 void setCustomViewport(GodotObject viewport) 371 { 372 checkClassBinding!(typeof(this))(); 373 ptrcall!(void)(_classBinding.setCustomViewport, _godot_object, viewport); 374 } 375 /** 376 377 */ 378 Node getCustomViewport() const 379 { 380 checkClassBinding!(typeof(this))(); 381 return ptrcall!(Node)(_classBinding.getCustomViewport, _godot_object); 382 } 383 /** 384 385 */ 386 void setFollowSmoothing(in double follow_smoothing) 387 { 388 checkClassBinding!(typeof(this))(); 389 ptrcall!(void)(_classBinding.setFollowSmoothing, _godot_object, follow_smoothing); 390 } 391 /** 392 393 */ 394 double getFollowSmoothing() const 395 { 396 checkClassBinding!(typeof(this))(); 397 return ptrcall!(double)(_classBinding.getFollowSmoothing, _godot_object); 398 } 399 /** 400 401 */ 402 void setEnableFollowSmoothing(in bool follow_smoothing) 403 { 404 checkClassBinding!(typeof(this))(); 405 ptrcall!(void)(_classBinding.setEnableFollowSmoothing, _godot_object, follow_smoothing); 406 } 407 /** 408 409 */ 410 bool isFollowSmoothingEnabled() const 411 { 412 checkClassBinding!(typeof(this))(); 413 return ptrcall!(bool)(_classBinding.isFollowSmoothingEnabled, _godot_object); 414 } 415 /** 416 Force the camera to update scroll immediately. 417 */ 418 void forceUpdateScroll() 419 { 420 checkClassBinding!(typeof(this))(); 421 ptrcall!(void)(_classBinding.forceUpdateScroll, _godot_object); 422 } 423 /** 424 Set the camera's position immediately to its current smoothing destination. 425 This has no effect if smoothing is disabled. 426 */ 427 void resetSmoothing() 428 { 429 checkClassBinding!(typeof(this))(); 430 ptrcall!(void)(_classBinding.resetSmoothing, _godot_object); 431 } 432 /** 433 Align the camera to the tracked node 434 */ 435 void _align() 436 { 437 checkClassBinding!(typeof(this))(); 438 ptrcall!(void)(_classBinding._align, _godot_object); 439 } 440 /** 441 442 */ 443 void _setOldSmoothing(in double follow_smoothing) 444 { 445 Array _GODOT_args = Array.empty_array; 446 _GODOT_args.append(follow_smoothing); 447 String _GODOT_method_name = String("_set_old_smoothing"); 448 this.callv(_GODOT_method_name, _GODOT_args); 449 } 450 /** 451 452 */ 453 void setScreenDrawingEnabled(in bool screen_drawing_enabled) 454 { 455 checkClassBinding!(typeof(this))(); 456 ptrcall!(void)(_classBinding.setScreenDrawingEnabled, _godot_object, screen_drawing_enabled); 457 } 458 /** 459 460 */ 461 bool isScreenDrawingEnabled() const 462 { 463 checkClassBinding!(typeof(this))(); 464 return ptrcall!(bool)(_classBinding.isScreenDrawingEnabled, _godot_object); 465 } 466 /** 467 468 */ 469 void setLimitDrawingEnabled(in bool limit_drawing_enabled) 470 { 471 checkClassBinding!(typeof(this))(); 472 ptrcall!(void)(_classBinding.setLimitDrawingEnabled, _godot_object, limit_drawing_enabled); 473 } 474 /** 475 476 */ 477 bool isLimitDrawingEnabled() const 478 { 479 checkClassBinding!(typeof(this))(); 480 return ptrcall!(bool)(_classBinding.isLimitDrawingEnabled, _godot_object); 481 } 482 /** 483 484 */ 485 void setMarginDrawingEnabled(in bool margin_drawing_enabled) 486 { 487 checkClassBinding!(typeof(this))(); 488 ptrcall!(void)(_classBinding.setMarginDrawingEnabled, _godot_object, margin_drawing_enabled); 489 } 490 /** 491 492 */ 493 bool isMarginDrawingEnabled() const 494 { 495 checkClassBinding!(typeof(this))(); 496 return ptrcall!(bool)(_classBinding.isMarginDrawingEnabled, _godot_object); 497 } 498 /** 499 The camera's offset, useful for looking around or camera shake animations. 500 */ 501 @property Vector2 offset() 502 { 503 return getOffset(); 504 } 505 /// ditto 506 @property void offset(Vector2 v) 507 { 508 setOffset(v); 509 } 510 /** 511 The Camera2D's anchor point. See `ANCHOR_MODE_*` constants. 512 */ 513 @property Camera2D.AnchorMode anchorMode() 514 { 515 return getAnchorMode(); 516 } 517 /// ditto 518 @property void anchorMode(long v) 519 { 520 setAnchorMode(v); 521 } 522 /** 523 If `true` the camera rotates with the target. Default value: `false` 524 */ 525 @property bool rotating() 526 { 527 return isRotating(); 528 } 529 /// ditto 530 @property void rotating(bool v) 531 { 532 setRotating(v); 533 } 534 /** 535 If `true` the camera is the active camera for the current scene. Only one camera can be current, so setting a different camera `current` will disable this one. 536 */ 537 @property bool current() 538 { 539 return isCurrent(); 540 } 541 /// ditto 542 @property void current(bool v) 543 { 544 _setCurrent(v); 545 } 546 /** 547 The camera's zoom relative to the viewport. Values larger than `Vector2(1, 1)` zoom out and smaller values zoom in. For an example, use `Vector2(0.5, 0.5)` for a 2x zoom in, and `Vector2(4, 4)` for a 4x zoom out. 548 */ 549 @property Vector2 zoom() 550 { 551 return getZoom(); 552 } 553 /// ditto 554 @property void zoom(Vector2 v) 555 { 556 setZoom(v); 557 } 558 /** 559 The custom $(D Viewport) node attached to the `Camera2D`. If null or not a $(D Viewport), uses the default viewport instead. 560 */ 561 @property Node customViewport() 562 { 563 return getCustomViewport(); 564 } 565 /// ditto 566 @property void customViewport(GodotObject v) 567 { 568 setCustomViewport(v); 569 } 570 /** 571 Left scroll limit in pixels. The camera stops moving when reaching this value. 572 */ 573 @property long limitLeft() 574 { 575 return getLimit(0); 576 } 577 /// ditto 578 @property void limitLeft(long v) 579 { 580 setLimit(0, v); 581 } 582 /** 583 Top scroll limit in pixels. The camera stops moving when reaching this value. 584 */ 585 @property long limitTop() 586 { 587 return getLimit(1); 588 } 589 /// ditto 590 @property void limitTop(long v) 591 { 592 setLimit(1, v); 593 } 594 /** 595 Right scroll limit in pixels. The camera stops moving when reaching this value. 596 */ 597 @property long limitRight() 598 { 599 return getLimit(2); 600 } 601 /// ditto 602 @property void limitRight(long v) 603 { 604 setLimit(2, v); 605 } 606 /** 607 Bottom scroll limit in pixels. The camera stops moving when reaching this value. 608 */ 609 @property long limitBottom() 610 { 611 return getLimit(3); 612 } 613 /// ditto 614 @property void limitBottom(long v) 615 { 616 setLimit(3, v); 617 } 618 /** 619 If `true` the camera smoothly stops when reaches its limits. Default value: `false` 620 */ 621 @property bool limitSmoothed() 622 { 623 return isLimitSmoothingEnabled(); 624 } 625 /// ditto 626 @property void limitSmoothed(bool v) 627 { 628 setLimitSmoothingEnabled(v); 629 } 630 /** 631 If `true` the camera only moves when reaching the horizontal drag margins. If `false` the camera moves horizontally regardless of margins. Default value: `true`. 632 */ 633 @property bool dragMarginHEnabled() 634 { 635 return isHDragEnabled(); 636 } 637 /// ditto 638 @property void dragMarginHEnabled(bool v) 639 { 640 setHDragEnabled(v); 641 } 642 /** 643 If `true` the camera only moves when reaching the vertical drag margins. If `false` the camera moves vertically regardless of margins. Default value: `true`. 644 */ 645 @property bool dragMarginVEnabled() 646 { 647 return isVDragEnabled(); 648 } 649 /// ditto 650 @property void dragMarginVEnabled(bool v) 651 { 652 setVDragEnabled(v); 653 } 654 /** 655 If `true` the camera smoothly moves towards the target at $(D smoothingSpeed). Default value: `false` 656 */ 657 @property bool smoothingEnabled() 658 { 659 return isFollowSmoothingEnabled(); 660 } 661 /// ditto 662 @property void smoothingEnabled(bool v) 663 { 664 setEnableFollowSmoothing(v); 665 } 666 /** 667 Speed in pixels per second of the camera's smoothing effect when $(D smoothingEnabled) is `true` 668 */ 669 @property double smoothingSpeed() 670 { 671 return getFollowSmoothing(); 672 } 673 /// ditto 674 @property void smoothingSpeed(double v) 675 { 676 setFollowSmoothing(v); 677 } 678 /** 679 The vertical offset of the camera, relative to the drag margins. Default value: `0` 680 */ 681 @property double offsetV() 682 { 683 return getVOffset(); 684 } 685 /// ditto 686 @property void offsetV(double v) 687 { 688 setVOffset(v); 689 } 690 /** 691 The horizontal offset of the camera, relative to the drag margins. Default value: `0` 692 */ 693 @property double offsetH() 694 { 695 return getHOffset(); 696 } 697 /// ditto 698 @property void offsetH(double v) 699 { 700 setHOffset(v); 701 } 702 /** 703 Left margin needed to drag the camera. A value of `1` makes the camera move only when reaching the edge of the screen. 704 */ 705 @property double dragMarginLeft() 706 { 707 return getDragMargin(0); 708 } 709 /// ditto 710 @property void dragMarginLeft(double v) 711 { 712 setDragMargin(0, v); 713 } 714 /** 715 Top margin needed to drag the camera. A value of `1` makes the camera move only when reaching the edge of the screen. 716 */ 717 @property double dragMarginTop() 718 { 719 return getDragMargin(1); 720 } 721 /// ditto 722 @property void dragMarginTop(double v) 723 { 724 setDragMargin(1, v); 725 } 726 /** 727 Right margin needed to drag the camera. A value of `1` makes the camera move only when reaching the edge of the screen. 728 */ 729 @property double dragMarginRight() 730 { 731 return getDragMargin(2); 732 } 733 /// ditto 734 @property void dragMarginRight(double v) 735 { 736 setDragMargin(2, v); 737 } 738 /** 739 Bottom margin needed to drag the camera. A value of `1` makes the camera move only when reaching the edge of the screen. 740 */ 741 @property double dragMarginBottom() 742 { 743 return getDragMargin(3); 744 } 745 /// ditto 746 @property void dragMarginBottom(double v) 747 { 748 setDragMargin(3, v); 749 } 750 /** 751 If `true` draws the camera's screen rectangle in the editor. Default value: `false` 752 */ 753 @property bool editorDrawScreen() 754 { 755 return isScreenDrawingEnabled(); 756 } 757 /// ditto 758 @property void editorDrawScreen(bool v) 759 { 760 setScreenDrawingEnabled(v); 761 } 762 /** 763 If `true` draws the camera's limits rectangle in the editor. Default value: `true` 764 */ 765 @property bool editorDrawLimits() 766 { 767 return isLimitDrawingEnabled(); 768 } 769 /// ditto 770 @property void editorDrawLimits(bool v) 771 { 772 setLimitDrawingEnabled(v); 773 } 774 /** 775 If `true` draws the camera's drag margin rectangle in the editor. Default value: `false` 776 */ 777 @property bool editorDrawDragMargin() 778 { 779 return isMarginDrawingEnabled(); 780 } 781 /// ditto 782 @property void editorDrawDragMargin(bool v) 783 { 784 setMarginDrawingEnabled(v); 785 } 786 }