1 /** 2 Contains a $(D Curve2D) path for $(D PathFollow2D) nodes to follow. 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.path2d; 14 import std.meta : AliasSeq, staticIndexOf; 15 import std.traits : Unqual; 16 import godot.d.traits; 17 import godot.core; 18 import godot.c; 19 import godot.d.bind; 20 import godot.d.reference; 21 import godot.globalenums; 22 import godot.object; 23 import godot.classdb; 24 import godot.node2d; 25 import godot.canvasitem; 26 import godot.node; 27 import godot.curve2d; 28 /** 29 Contains a $(D Curve2D) path for $(D PathFollow2D) nodes to follow. 30 31 Can have $(D PathFollow2D) child nodes moving along the $(D Curve2D). See $(D PathFollow2D) for more information on usage. 32 $(B Note:) The path is considered as relative to the moved nodes (children of $(D PathFollow2D)). As such, the curve should usually start with a zero vector (`(0, 0)`). 33 */ 34 @GodotBaseClass struct Path2D 35 { 36 package(godot) enum string _GODOT_internal_name = "Path2D"; 37 public: 38 @nogc nothrow: 39 union { /** */ godot_object _godot_object; /** */ Node2D _GODOT_base; } 40 alias _GODOT_base this; 41 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 42 package(godot) __gshared bool _classBindingInitialized = false; 43 package(godot) static struct GDNativeClassBinding 44 { 45 __gshared: 46 @GodotName("_curve_changed") GodotMethod!(void) _curveChanged; 47 @GodotName("get_curve") GodotMethod!(Curve2D) getCurve; 48 @GodotName("set_curve") GodotMethod!(void, Curve2D) setCurve; 49 } 50 /// 51 pragma(inline, true) bool opEquals(in Path2D other) const 52 { return _godot_object.ptr is other._godot_object.ptr; } 53 /// 54 pragma(inline, true) typeof(null) opAssign(typeof(null) n) 55 { _godot_object.ptr = n; return null; } 56 /// 57 pragma(inline, true) bool opEquals(typeof(null) n) const 58 { return _godot_object.ptr is n; } 59 /// 60 size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; } 61 mixin baseCasts; 62 /// Construct a new instance of Path2D. 63 /// Note: use `memnew!Path2D` instead. 64 static Path2D _new() 65 { 66 static godot_class_constructor constructor; 67 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("Path2D"); 68 if(constructor is null) return typeof(this).init; 69 return cast(Path2D)(constructor()); 70 } 71 @disable new(size_t s); 72 /** 73 74 */ 75 void _curveChanged() 76 { 77 Array _GODOT_args = Array.make(); 78 String _GODOT_method_name = String("_curve_changed"); 79 this.callv(_GODOT_method_name, _GODOT_args); 80 } 81 /** 82 83 */ 84 Ref!Curve2D getCurve() const 85 { 86 checkClassBinding!(typeof(this))(); 87 return ptrcall!(Curve2D)(GDNativeClassBinding.getCurve, _godot_object); 88 } 89 /** 90 91 */ 92 void setCurve(Curve2D curve) 93 { 94 checkClassBinding!(typeof(this))(); 95 ptrcall!(void)(GDNativeClassBinding.setCurve, _godot_object, curve); 96 } 97 /** 98 A $(D Curve2D) describing the path. 99 */ 100 @property Curve2D curve() 101 { 102 return getCurve(); 103 } 104 /// ditto 105 @property void curve(Curve2D v) 106 { 107 setCurve(v); 108 } 109 }