1 /** 2 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.texturelayered; 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.resource; 23 import godot.image; 24 import godot.reference; 25 /** 26 27 */ 28 @GodotBaseClass struct TextureLayered 29 { 30 enum string _GODOT_internal_name = "TextureLayered"; 31 public: 32 @nogc nothrow: 33 union { godot_object _godot_object; Resource _GODOT_base; } 34 alias _GODOT_base this; 35 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 36 package(godot) __gshared bool _classBindingInitialized = false; 37 package(godot) static struct _classBinding 38 { 39 __gshared: 40 @GodotName("set_flags") GodotMethod!(void, long) setFlags; 41 @GodotName("get_flags") GodotMethod!(long) getFlags; 42 @GodotName("get_format") GodotMethod!(Image.Format) getFormat; 43 @GodotName("get_width") GodotMethod!(long) getWidth; 44 @GodotName("get_height") GodotMethod!(long) getHeight; 45 @GodotName("get_depth") GodotMethod!(long) getDepth; 46 @GodotName("create") GodotMethod!(void, long, long, long, long, long) create; 47 @GodotName("set_layer_data") GodotMethod!(void, Image, long) setLayerData; 48 @GodotName("get_layer_data") GodotMethod!(Image, long) getLayerData; 49 @GodotName("set_data_partial") GodotMethod!(void, Image, long, long, long, long) setDataPartial; 50 @GodotName("_set_data") GodotMethod!(void, Dictionary) _setData; 51 @GodotName("_get_data") GodotMethod!(Dictionary) _getData; 52 } 53 bool opEquals(in TextureLayered other) const { return _godot_object.ptr is other._godot_object.ptr; } 54 TextureLayered opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 55 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 56 mixin baseCasts; 57 static TextureLayered _new() 58 { 59 static godot_class_constructor constructor; 60 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("TextureLayered"); 61 if(constructor is null) return typeof(this).init; 62 return cast(TextureLayered)(constructor()); 63 } 64 @disable new(size_t s); 65 /// 66 enum Flags : int 67 { 68 /** 69 70 */ 71 flagMipmaps = 1, 72 /** 73 74 */ 75 flagRepeat = 2, 76 /** 77 78 */ 79 flagFilter = 4, 80 /** 81 82 */ 83 flagsDefault = 4, 84 } 85 /// 86 enum Constants : int 87 { 88 flagMipmaps = 1, 89 flagRepeat = 2, 90 flagFilter = 4, 91 flagsDefault = 4, 92 } 93 /** 94 95 */ 96 void setFlags(in long flags) 97 { 98 checkClassBinding!(typeof(this))(); 99 ptrcall!(void)(_classBinding.setFlags, _godot_object, flags); 100 } 101 /** 102 103 */ 104 long getFlags() const 105 { 106 checkClassBinding!(typeof(this))(); 107 return ptrcall!(long)(_classBinding.getFlags, _godot_object); 108 } 109 /** 110 111 */ 112 Image.Format getFormat() const 113 { 114 checkClassBinding!(typeof(this))(); 115 return ptrcall!(Image.Format)(_classBinding.getFormat, _godot_object); 116 } 117 /** 118 119 */ 120 long getWidth() const 121 { 122 checkClassBinding!(typeof(this))(); 123 return ptrcall!(long)(_classBinding.getWidth, _godot_object); 124 } 125 /** 126 127 */ 128 long getHeight() const 129 { 130 checkClassBinding!(typeof(this))(); 131 return ptrcall!(long)(_classBinding.getHeight, _godot_object); 132 } 133 /** 134 135 */ 136 long getDepth() const 137 { 138 checkClassBinding!(typeof(this))(); 139 return ptrcall!(long)(_classBinding.getDepth, _godot_object); 140 } 141 /** 142 143 */ 144 void create(in long width, in long height, in long depth, in long format, in long flags = 4) 145 { 146 checkClassBinding!(typeof(this))(); 147 ptrcall!(void)(_classBinding.create, _godot_object, width, height, depth, format, flags); 148 } 149 /** 150 151 */ 152 void setLayerData(Image image, in long layer) 153 { 154 checkClassBinding!(typeof(this))(); 155 ptrcall!(void)(_classBinding.setLayerData, _godot_object, image, layer); 156 } 157 /** 158 159 */ 160 Ref!Image getLayerData(in long layer) const 161 { 162 checkClassBinding!(typeof(this))(); 163 return ptrcall!(Image)(_classBinding.getLayerData, _godot_object, layer); 164 } 165 /** 166 167 */ 168 void setDataPartial(Image image, in long x_offset, in long y_offset, in long layer, in long mipmap = 0) 169 { 170 checkClassBinding!(typeof(this))(); 171 ptrcall!(void)(_classBinding.setDataPartial, _godot_object, image, x_offset, y_offset, layer, mipmap); 172 } 173 /** 174 175 */ 176 void _setData(in Dictionary data) 177 { 178 Array _GODOT_args = Array.empty_array; 179 _GODOT_args.append(data); 180 String _GODOT_method_name = String("_set_data"); 181 this.callv(_GODOT_method_name, _GODOT_args); 182 } 183 /** 184 185 */ 186 Dictionary _getData() const 187 { 188 Array _GODOT_args = Array.empty_array; 189 String _GODOT_method_name = String("_get_data"); 190 return this.callv(_GODOT_method_name, _GODOT_args).as!(RefOrT!Dictionary); 191 } 192 /** 193 194 */ 195 @property long flags() 196 { 197 return getFlags(); 198 } 199 /// ditto 200 @property void flags(long v) 201 { 202 setFlags(v); 203 } 204 /** 205 206 */ 207 @property Dictionary data() 208 { 209 return _getData(); 210 } 211 /// ditto 212 @property void data(Dictionary v) 213 { 214 _setData(v); 215 } 216 }