mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-03 01:19:38 +01:00
Expose VisualServer.texture_set_proxy() to GDScript
Expose VisualServer.texture_set_proxy() to GDScript
This commit is contained in:
parent
3a191189ca
commit
fa0b1f561a
@ -2343,6 +2343,29 @@
|
|||||||
Sets the texture's path.
|
Sets the texture's path.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
|
<method name="texture_set_proxy">
|
||||||
|
<return type="void" />
|
||||||
|
<argument index="0" name="proxy" type="RID" />
|
||||||
|
<argument index="1" name="base" type="RID" />
|
||||||
|
<description>
|
||||||
|
Creates an update link between two textures, similar to how [ViewportTexture]s operate. When the base texture is the texture of a [Viewport], every time the viewport renders a new frame, the proxy texture automatically receives an update.
|
||||||
|
For example, this code links a generic [ImageTexture] to the texture output of the [Viewport] using the VisualServer API:
|
||||||
|
[codeblock]
|
||||||
|
func _ready():
|
||||||
|
var viewport_rid = get_viewport().get_viewport_rid()
|
||||||
|
var viewport_texture_rid = VisualServer.viewport_get_texture(viewport_rid)
|
||||||
|
|
||||||
|
var proxy_texture = ImageTexture.new()
|
||||||
|
var viewport_texture_image_data = VisualServer.texture_get_data(viewport_texture_rid)
|
||||||
|
|
||||||
|
proxy_texture.create_from_image(viewport_texture_image_data)
|
||||||
|
var proxy_texture_rid = proxy_texture.get_rid()
|
||||||
|
VisualServer.texture_set_proxy(proxy_texture_rid, viewport_texture_rid)
|
||||||
|
|
||||||
|
$TextureRect.texture = proxy_texture
|
||||||
|
[/codeblock]
|
||||||
|
</description>
|
||||||
|
</method>
|
||||||
<method name="texture_set_shrink_all_x2_on_set_data">
|
<method name="texture_set_shrink_all_x2_on_set_data">
|
||||||
<return type="void" />
|
<return type="void" />
|
||||||
<argument index="0" name="shrink" type="bool" />
|
<argument index="0" name="shrink" type="bool" />
|
||||||
|
@ -1861,6 +1861,7 @@ void VisualServer::_bind_methods() {
|
|||||||
ClassDB::bind_method(D_METHOD("texture_set_path", "texture", "path"), &VisualServer::texture_set_path);
|
ClassDB::bind_method(D_METHOD("texture_set_path", "texture", "path"), &VisualServer::texture_set_path);
|
||||||
ClassDB::bind_method(D_METHOD("texture_get_path", "texture"), &VisualServer::texture_get_path);
|
ClassDB::bind_method(D_METHOD("texture_get_path", "texture"), &VisualServer::texture_get_path);
|
||||||
ClassDB::bind_method(D_METHOD("texture_set_shrink_all_x2_on_set_data", "shrink"), &VisualServer::texture_set_shrink_all_x2_on_set_data);
|
ClassDB::bind_method(D_METHOD("texture_set_shrink_all_x2_on_set_data", "shrink"), &VisualServer::texture_set_shrink_all_x2_on_set_data);
|
||||||
|
ClassDB::bind_method(D_METHOD("texture_set_proxy", "proxy", "base"), &VisualServer::texture_set_proxy);
|
||||||
ClassDB::bind_method(D_METHOD("texture_bind", "texture", "number"), &VisualServer::texture_bind);
|
ClassDB::bind_method(D_METHOD("texture_bind", "texture", "number"), &VisualServer::texture_bind);
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("texture_debug_usage"), &VisualServer::_texture_debug_usage_bind);
|
ClassDB::bind_method(D_METHOD("texture_debug_usage"), &VisualServer::_texture_debug_usage_bind);
|
||||||
|
Loading…
Reference in New Issue
Block a user