1 /** 2 RemoteTransform2D pushes its own $(D Transform2D) to another $(D CanvasItem) derived Node in the scene. 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.remotetransform2d; 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.canvasitem; 25 import godot.node; 26 /** 27 RemoteTransform2D pushes its own $(D Transform2D) to another $(D CanvasItem) derived Node in the scene. 28 29 RemoteTransform2D pushes its own $(D Transform2D) to another $(D CanvasItem) derived Node (called the remote node) in the scene. 30 It can be set to update another Node's position, rotation and/or scale. It can use either global or local coordinates. 31 */ 32 @GodotBaseClass struct RemoteTransform2D 33 { 34 enum string _GODOT_internal_name = "RemoteTransform2D"; 35 public: 36 @nogc nothrow: 37 union { godot_object _godot_object; Node2D _GODOT_base; } 38 alias _GODOT_base this; 39 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 40 package(godot) __gshared bool _classBindingInitialized = false; 41 package(godot) static struct _classBinding 42 { 43 __gshared: 44 @GodotName("set_remote_node") GodotMethod!(void, NodePath) setRemoteNode; 45 @GodotName("get_remote_node") GodotMethod!(NodePath) getRemoteNode; 46 @GodotName("set_use_global_coordinates") GodotMethod!(void, bool) setUseGlobalCoordinates; 47 @GodotName("get_use_global_coordinates") GodotMethod!(bool) getUseGlobalCoordinates; 48 @GodotName("set_update_position") GodotMethod!(void, bool) setUpdatePosition; 49 @GodotName("get_update_position") GodotMethod!(bool) getUpdatePosition; 50 @GodotName("set_update_rotation") GodotMethod!(void, bool) setUpdateRotation; 51 @GodotName("get_update_rotation") GodotMethod!(bool) getUpdateRotation; 52 @GodotName("set_update_scale") GodotMethod!(void, bool) setUpdateScale; 53 @GodotName("get_update_scale") GodotMethod!(bool) getUpdateScale; 54 } 55 bool opEquals(in RemoteTransform2D other) const { return _godot_object.ptr is other._godot_object.ptr; } 56 RemoteTransform2D opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 57 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 58 mixin baseCasts; 59 static RemoteTransform2D _new() 60 { 61 static godot_class_constructor constructor; 62 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("RemoteTransform2D"); 63 if(constructor is null) return typeof(this).init; 64 return cast(RemoteTransform2D)(constructor()); 65 } 66 @disable new(size_t s); 67 /** 68 69 */ 70 void setRemoteNode(NodePathArg0)(in NodePathArg0 path) 71 { 72 checkClassBinding!(typeof(this))(); 73 ptrcall!(void)(_classBinding.setRemoteNode, _godot_object, path); 74 } 75 /** 76 77 */ 78 NodePath getRemoteNode() const 79 { 80 checkClassBinding!(typeof(this))(); 81 return ptrcall!(NodePath)(_classBinding.getRemoteNode, _godot_object); 82 } 83 /** 84 85 */ 86 void setUseGlobalCoordinates(in bool use_global_coordinates) 87 { 88 checkClassBinding!(typeof(this))(); 89 ptrcall!(void)(_classBinding.setUseGlobalCoordinates, _godot_object, use_global_coordinates); 90 } 91 /** 92 93 */ 94 bool getUseGlobalCoordinates() const 95 { 96 checkClassBinding!(typeof(this))(); 97 return ptrcall!(bool)(_classBinding.getUseGlobalCoordinates, _godot_object); 98 } 99 /** 100 101 */ 102 void setUpdatePosition(in bool update_remote_position) 103 { 104 checkClassBinding!(typeof(this))(); 105 ptrcall!(void)(_classBinding.setUpdatePosition, _godot_object, update_remote_position); 106 } 107 /** 108 109 */ 110 bool getUpdatePosition() const 111 { 112 checkClassBinding!(typeof(this))(); 113 return ptrcall!(bool)(_classBinding.getUpdatePosition, _godot_object); 114 } 115 /** 116 117 */ 118 void setUpdateRotation(in bool update_remote_rotation) 119 { 120 checkClassBinding!(typeof(this))(); 121 ptrcall!(void)(_classBinding.setUpdateRotation, _godot_object, update_remote_rotation); 122 } 123 /** 124 125 */ 126 bool getUpdateRotation() const 127 { 128 checkClassBinding!(typeof(this))(); 129 return ptrcall!(bool)(_classBinding.getUpdateRotation, _godot_object); 130 } 131 /** 132 133 */ 134 void setUpdateScale(in bool update_remote_scale) 135 { 136 checkClassBinding!(typeof(this))(); 137 ptrcall!(void)(_classBinding.setUpdateScale, _godot_object, update_remote_scale); 138 } 139 /** 140 141 */ 142 bool getUpdateScale() const 143 { 144 checkClassBinding!(typeof(this))(); 145 return ptrcall!(bool)(_classBinding.getUpdateScale, _godot_object); 146 } 147 /** 148 The $(D NodePath) to the remote node, relative to the RemoteTransform2D's position in the scene. 149 */ 150 @property NodePath remotePath() 151 { 152 return getRemoteNode(); 153 } 154 /// ditto 155 @property void remotePath(NodePath v) 156 { 157 setRemoteNode(v); 158 } 159 /** 160 If `true` global coordinates are used. If `false` local coordinates are used. Default value: `true`. 161 */ 162 @property bool useGlobalCoordinates() 163 { 164 return getUseGlobalCoordinates(); 165 } 166 /// ditto 167 @property void useGlobalCoordinates(bool v) 168 { 169 setUseGlobalCoordinates(v); 170 } 171 /** 172 If `true` the remote node's position is updated. Default value: `true`. 173 */ 174 @property bool updatePosition() 175 { 176 return getUpdatePosition(); 177 } 178 /// ditto 179 @property void updatePosition(bool v) 180 { 181 setUpdatePosition(v); 182 } 183 /** 184 If `true` the remote node's rotation is updated. Default value: `true`. 185 */ 186 @property bool updateRotation() 187 { 188 return getUpdateRotation(); 189 } 190 /// ditto 191 @property void updateRotation(bool v) 192 { 193 setUpdateRotation(v); 194 } 195 /** 196 If `true` the remote node's scale is updated. Default value: `true`. 197 */ 198 @property bool updateScale() 199 { 200 return getUpdateScale(); 201 } 202 /// ditto 203 @property void updateScale(bool v) 204 { 205 setUpdateScale(v); 206 } 207 }