From 25dd96179ca38da52762000594c35ec30b22a5da Mon Sep 17 00:00:00 2001 From: BigPotatoAss Date: Sat, 19 Oct 2024 22:19:00 +0330 Subject: [PATCH] bound is_pixel_opaque() properly --- doc/classes/Texture2D.xml | 7 +++++++ scene/resources/texture.cpp | 1 + 2 files changed, 8 insertions(+) diff --git a/doc/classes/Texture2D.xml b/doc/classes/Texture2D.xml index 7254a92e36d..e5a71fab95a 100644 --- a/doc/classes/Texture2D.xml +++ b/doc/classes/Texture2D.xml @@ -145,5 +145,12 @@ Returns [code]true[/code] if this [Texture2D] has an alpha channel. + + + + + + + diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 7713181a4be..2de4254cd4c 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -104,6 +104,7 @@ void Texture2D::_bind_methods() { ClassDB::bind_method(D_METHOD("draw_rect_region", "canvas_item", "rect", "src_rect", "modulate", "transpose", "clip_uv"), &Texture2D::draw_rect_region, DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(true)); ClassDB::bind_method(D_METHOD("get_image"), &Texture2D::get_image); ClassDB::bind_method(D_METHOD("create_placeholder"), &Texture2D::create_placeholder); + ClassDB::bind_method(D_METHOD("is_pixel_opaque", "p_x", "p_y"), &Texture2D::is_pixel_opaque); ADD_GROUP("", "");