1 /**
2 Gradient-filled texture.
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.gradienttexture;
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.texture;
25 import godot.gradient;
26 /**
27 Gradient-filled texture.
28 
29 GradientTexture uses a $(D Gradient) to fill the texture data. The gradient will be filled from left to right using colors obtained from the gradient. This means the texture does not necessarily represent an exact copy of the gradient, but instead an interpolation of samples obtained from the gradient at fixed steps (see $(D width)).
30 */
31 @GodotBaseClass struct GradientTexture
32 {
33 	package(godot) enum string _GODOT_internal_name = "GradientTexture";
34 public:
35 @nogc nothrow:
36 	union { /** */ godot_object _godot_object; /** */ Texture _GODOT_base; }
37 	alias _GODOT_base this;
38 	alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses);
39 	package(godot) __gshared bool _classBindingInitialized = false;
40 	package(godot) static struct GDNativeClassBinding
41 	{
42 		__gshared:
43 		@GodotName("_update") GodotMethod!(void) _update;
44 		@GodotName("get_gradient") GodotMethod!(Gradient) getGradient;
45 		@GodotName("set_gradient") GodotMethod!(void, Gradient) setGradient;
46 		@GodotName("set_width") GodotMethod!(void, long) setWidth;
47 	}
48 	/// 
49 	pragma(inline, true) bool opEquals(in GradientTexture other) const
50 	{ return _godot_object.ptr is other._godot_object.ptr; }
51 	/// 
52 	pragma(inline, true) typeof(null) opAssign(typeof(null) n)
53 	{ _godot_object.ptr = n; return null; }
54 	/// 
55 	pragma(inline, true) bool opEquals(typeof(null) n) const
56 	{ return _godot_object.ptr is n; }
57 	/// 
58 	size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; }
59 	mixin baseCasts;
60 	/// Construct a new instance of GradientTexture.
61 	/// Note: use `memnew!GradientTexture` instead.
62 	static GradientTexture _new()
63 	{
64 		static godot_class_constructor constructor;
65 		if(constructor is null) constructor = _godot_api.godot_get_class_constructor("GradientTexture");
66 		if(constructor is null) return typeof(this).init;
67 		return cast(GradientTexture)(constructor());
68 	}
69 	@disable new(size_t s);
70 	/**
71 	
72 	*/
73 	void _update()
74 	{
75 		Array _GODOT_args = Array.make();
76 		String _GODOT_method_name = String("_update");
77 		this.callv(_GODOT_method_name, _GODOT_args);
78 	}
79 	/**
80 	
81 	*/
82 	Ref!Gradient getGradient() const
83 	{
84 		checkClassBinding!(typeof(this))();
85 		return ptrcall!(Gradient)(GDNativeClassBinding.getGradient, _godot_object);
86 	}
87 	/**
88 	
89 	*/
90 	void setGradient(Gradient gradient)
91 	{
92 		checkClassBinding!(typeof(this))();
93 		ptrcall!(void)(GDNativeClassBinding.setGradient, _godot_object, gradient);
94 	}
95 	/**
96 	
97 	*/
98 	void setWidth(in long width)
99 	{
100 		checkClassBinding!(typeof(this))();
101 		ptrcall!(void)(GDNativeClassBinding.setWidth, _godot_object, width);
102 	}
103 	/**
104 	The $(D Gradient) that will be used to fill the texture.
105 	*/
106 	@property Gradient gradient()
107 	{
108 		return getGradient();
109 	}
110 	/// ditto
111 	@property void gradient(Gradient v)
112 	{
113 		setGradient(v);
114 	}
115 	/**
116 	The number of color samples that will be obtained from the $(D Gradient).
117 	*/
118 	@property long width()
119 	{
120 		return getWidth();
121 	}
122 	/// ditto
123 	@property void width(long v)
124 	{
125 		setWidth(v);
126 	}
127 }