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