1 /**
2 Generic 2D position hint for editing.
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.position2d;
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 Generic 2D position hint for editing.
29 
30 It's just like a plain $(D Node2D), but it displays as a cross in the 2D editor at all times. You can set cross' visual size by using the gizmo in the 2D editor while the node is selected.
31 */
32 @GodotBaseClass struct Position2D
33 {
34 	package(godot) enum string _GODOT_internal_name = "Position2D";
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 GDNativeClassBinding
42 	{
43 		__gshared:
44 		@GodotName("_get_gizmo_extents") GodotMethod!(double) _getGizmoExtents;
45 		@GodotName("_set_gizmo_extents") GodotMethod!(void, double) _setGizmoExtents;
46 	}
47 	/// 
48 	pragma(inline, true) bool opEquals(in Position2D other) const
49 	{ return _godot_object.ptr is other._godot_object.ptr; }
50 	/// 
51 	pragma(inline, true) typeof(null) opAssign(typeof(null) n)
52 	{ _godot_object.ptr = n; return null; }
53 	/// 
54 	pragma(inline, true) bool opEquals(typeof(null) n) const
55 	{ return _godot_object.ptr is n; }
56 	/// 
57 	size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; }
58 	mixin baseCasts;
59 	/// Construct a new instance of Position2D.
60 	/// Note: use `memnew!Position2D` instead.
61 	static Position2D _new()
62 	{
63 		static godot_class_constructor constructor;
64 		if(constructor is null) constructor = _godot_api.godot_get_class_constructor("Position2D");
65 		if(constructor is null) return typeof(this).init;
66 		return cast(Position2D)(constructor());
67 	}
68 	@disable new(size_t s);
69 	/**
70 	
71 	*/
72 	double _getGizmoExtents() const
73 	{
74 		Array _GODOT_args = Array.make();
75 		String _GODOT_method_name = String("_get_gizmo_extents");
76 		return this.callv(_GODOT_method_name, _GODOT_args).as!(RefOrT!double);
77 	}
78 	/**
79 	
80 	*/
81 	void _setGizmoExtents(in double extents)
82 	{
83 		Array _GODOT_args = Array.make();
84 		_GODOT_args.append(extents);
85 		String _GODOT_method_name = String("_set_gizmo_extents");
86 		this.callv(_GODOT_method_name, _GODOT_args);
87 	}
88 	/**
89 	
90 	*/
91 	@property double gizmoExtents()
92 	{
93 		return _getGizmoExtents();
94 	}
95 	/// ditto
96 	@property void gizmoExtents(double v)
97 	{
98 		_setGizmoExtents(v);
99 	}
100 }