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.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.texture;
24 import godot.gradient;
25 import godot.resource;
26 import godot.reference;
27 /**
28 Gradient filled texture.
29 
30 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 that 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 setWidth)).
31 */
32 @GodotBaseClass struct GradientTexture
33 {
34 	enum string _GODOT_internal_name = "GradientTexture";
35 public:
36 @nogc nothrow:
37 	union { godot_object _godot_object; Texture _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_gradient") GodotMethod!(void, Gradient) setGradient;
45 		@GodotName("get_gradient") GodotMethod!(Gradient) getGradient;
46 		@GodotName("set_width") GodotMethod!(void, long) setWidth;
47 		@GodotName("_update") GodotMethod!(void) _update;
48 	}
49 	bool opEquals(in GradientTexture other) const { return _godot_object.ptr is other._godot_object.ptr; }
50 	GradientTexture opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; }
51 	bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; }
52 	mixin baseCasts;
53 	static GradientTexture _new()
54 	{
55 		static godot_class_constructor constructor;
56 		if(constructor is null) constructor = _godot_api.godot_get_class_constructor("GradientTexture");
57 		if(constructor is null) return typeof(this).init;
58 		return cast(GradientTexture)(constructor());
59 	}
60 	@disable new(size_t s);
61 	/**
62 	
63 	*/
64 	void setGradient(Gradient gradient)
65 	{
66 		checkClassBinding!(typeof(this))();
67 		ptrcall!(void)(_classBinding.setGradient, _godot_object, gradient);
68 	}
69 	/**
70 	
71 	*/
72 	Ref!Gradient getGradient() const
73 	{
74 		checkClassBinding!(typeof(this))();
75 		return ptrcall!(Gradient)(_classBinding.getGradient, _godot_object);
76 	}
77 	/**
78 	
79 	*/
80 	void setWidth(in long width)
81 	{
82 		checkClassBinding!(typeof(this))();
83 		ptrcall!(void)(_classBinding.setWidth, _godot_object, width);
84 	}
85 	/**
86 	
87 	*/
88 	void _update()
89 	{
90 		Array _GODOT_args = Array.empty_array;
91 		String _GODOT_method_name = String("_update");
92 		this.callv(_GODOT_method_name, _GODOT_args);
93 	}
94 	/**
95 	The $(D Gradient) that will be used to fill the texture.
96 	*/
97 	@property Gradient gradient()
98 	{
99 		return getGradient();
100 	}
101 	/// ditto
102 	@property void gradient(Gradient v)
103 	{
104 		setGradient(v);
105 	}
106 	/**
107 	The number of color samples that will be obtained from the $(D Gradient).
108 	*/
109 	@property long width()
110 	{
111 		return getWidth();
112 	}
113 	/// ditto
114 	@property void width(long v)
115 	{
116 		setWidth(v);
117 	}
118 }