1 /** 2 A texture that shows a curve. 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.curvetexture; 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.curve; 25 import godot.resource; 26 import godot.reference; 27 /** 28 A texture that shows a curve. 29 30 Renders a given $(D Curve) provided to it. Simplifies the task of drawing curves and/or saving them as image files. 31 */ 32 @GodotBaseClass struct CurveTexture 33 { 34 enum string _GODOT_internal_name = "CurveTexture"; 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_width") GodotMethod!(void, long) setWidth; 45 @GodotName("set_curve") GodotMethod!(void, Curve) setCurve; 46 @GodotName("get_curve") GodotMethod!(Curve) getCurve; 47 @GodotName("_update") GodotMethod!(void) _update; 48 } 49 bool opEquals(in CurveTexture other) const { return _godot_object.ptr is other._godot_object.ptr; } 50 CurveTexture 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 CurveTexture _new() 54 { 55 static godot_class_constructor constructor; 56 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("CurveTexture"); 57 if(constructor is null) return typeof(this).init; 58 return cast(CurveTexture)(constructor()); 59 } 60 @disable new(size_t s); 61 /** 62 63 */ 64 void setWidth(in long width) 65 { 66 checkClassBinding!(typeof(this))(); 67 ptrcall!(void)(_classBinding.setWidth, _godot_object, width); 68 } 69 /** 70 71 */ 72 void setCurve(Curve curve) 73 { 74 checkClassBinding!(typeof(this))(); 75 ptrcall!(void)(_classBinding.setCurve, _godot_object, curve); 76 } 77 /** 78 79 */ 80 Ref!Curve getCurve() const 81 { 82 checkClassBinding!(typeof(this))(); 83 return ptrcall!(Curve)(_classBinding.getCurve, _godot_object); 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 width of the texture. 96 */ 97 @property long width() 98 { 99 return getWidth(); 100 } 101 /// ditto 102 @property void width(long v) 103 { 104 setWidth(v); 105 } 106 /** 107 The `curve` rendered onto the texture. 108 */ 109 @property Curve curve() 110 { 111 return getCurve(); 112 } 113 /// ditto 114 @property void curve(Curve v) 115 { 116 setCurve(v); 117 } 118 }