1 /** 2 Texture which displays the content of a $(D Viewport). 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.viewporttexture; 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.resource; 25 import godot.reference; 26 /** 27 Texture which displays the content of a $(D Viewport). 28 29 Displays the content of a $(D Viewport) node as a dynamic $(D Texture). This can be used to mix controls, 2D, and 3D elements in the same scene. 30 To create a ViewportTexture in code, use the $(D Viewport.getTexture) method on the target viewport. 31 */ 32 @GodotBaseClass struct ViewportTexture 33 { 34 enum string _GODOT_internal_name = "ViewportTexture"; 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_viewport_path_in_scene") GodotMethod!(void, NodePath) setViewportPathInScene; 45 @GodotName("get_viewport_path_in_scene") GodotMethod!(NodePath) getViewportPathInScene; 46 } 47 bool opEquals(in ViewportTexture other) const { return _godot_object.ptr is other._godot_object.ptr; } 48 ViewportTexture opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 49 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 50 mixin baseCasts; 51 static ViewportTexture _new() 52 { 53 static godot_class_constructor constructor; 54 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("ViewportTexture"); 55 if(constructor is null) return typeof(this).init; 56 return cast(ViewportTexture)(constructor()); 57 } 58 @disable new(size_t s); 59 /** 60 61 */ 62 void setViewportPathInScene(NodePathArg0)(in NodePathArg0 path) 63 { 64 checkClassBinding!(typeof(this))(); 65 ptrcall!(void)(_classBinding.setViewportPathInScene, _godot_object, path); 66 } 67 /** 68 69 */ 70 NodePath getViewportPathInScene() const 71 { 72 checkClassBinding!(typeof(this))(); 73 return ptrcall!(NodePath)(_classBinding.getViewportPathInScene, _godot_object); 74 } 75 /** 76 The path to the $(D Viewport) node to display. This is relative to the scene root, not to the node which uses the texture. 77 */ 78 @property NodePath viewportPath() 79 { 80 return getViewportPathInScene(); 81 } 82 /// ditto 83 @property void viewportPath(NodePath v) 84 { 85 setViewportPathInScene(v); 86 } 87 }