1 /** 2 A $(D Color) constant to be used within the visual shader graph. 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.visualshadernodecolorconstant; 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.visualshadernode; 25 import godot.resource; 26 import godot.reference; 27 /** 28 A $(D Color) constant to be used within the visual shader graph. 29 30 Has two output ports representing RGB and alpha channels of $(D Color). 31 Translated to `vec3 rgb` and `float alpha` in the shader language. 32 */ 33 @GodotBaseClass struct VisualShaderNodeColorConstant 34 { 35 package(godot) enum string _GODOT_internal_name = "VisualShaderNodeColorConstant"; 36 public: 37 @nogc nothrow: 38 union { /** */ godot_object _godot_object; /** */ VisualShaderNode _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("get_constant") GodotMethod!(Color) getConstant; 46 @GodotName("set_constant") GodotMethod!(void, Color) setConstant; 47 } 48 /// 49 pragma(inline, true) bool opEquals(in VisualShaderNodeColorConstant 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 VisualShaderNodeColorConstant. 61 /// Note: use `memnew!VisualShaderNodeColorConstant` instead. 62 static VisualShaderNodeColorConstant _new() 63 { 64 static godot_class_constructor constructor; 65 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("VisualShaderNodeColorConstant"); 66 if(constructor is null) return typeof(this).init; 67 return cast(VisualShaderNodeColorConstant)(constructor()); 68 } 69 @disable new(size_t s); 70 /** 71 72 */ 73 Color getConstant() const 74 { 75 checkClassBinding!(typeof(this))(); 76 return ptrcall!(Color)(GDNativeClassBinding.getConstant, _godot_object); 77 } 78 /** 79 80 */ 81 void setConstant(in Color value) 82 { 83 checkClassBinding!(typeof(this))(); 84 ptrcall!(void)(GDNativeClassBinding.setConstant, _godot_object, value); 85 } 86 /** 87 A $(D Color) constant which represents a state of this node. 88 */ 89 @property Color constant() 90 { 91 return getConstant(); 92 } 93 /// ditto 94 @property void constant(Color v) 95 { 96 setConstant(v); 97 } 98 }