diff --git a/modules/paint/nodes/paint_canvas.cpp b/modules/paint/nodes/paint_canvas.cpp index c5dcb8290..ff9185319 100644 --- a/modules/paint/nodes/paint_canvas.cpp +++ b/modules/paint/nodes/paint_canvas.cpp @@ -264,6 +264,20 @@ PoolVector2iArray PaintCanvas::get_neighbouring_pixels(const int pos_x, const in return pixels; } +Ref PaintCanvas::get_image() { + return _image; +} +Ref PaintCanvas::get_preview_image() { + return _preview_image; +} + +Ref PaintCanvas::get_image_texture() { + return _image_texture; +} +Ref PaintCanvas::get_preview_image_texture() { + return _preview_image_texture; +} + PaintCanvas::PaintCanvas() { _symmetry_x = false; _symmetry_y = false; @@ -328,4 +342,10 @@ void PaintCanvas::_bind_methods() { ClassDB::bind_method(D_METHOD("select_color", "x", "y"), &PaintCanvas::select_color); ClassDB::bind_method(D_METHOD("select_same_color", "x", "y"), &PaintCanvas::select_same_color); ClassDB::bind_method(D_METHOD("get_neighbouring_pixels", "x", "y"), &PaintCanvas::get_neighbouring_pixels); + + ClassDB::bind_method(D_METHOD("get_image"), &PaintCanvas::get_image); + ClassDB::bind_method(D_METHOD("get_preview_image"), &PaintCanvas::get_preview_image); + + ClassDB::bind_method(D_METHOD("get_image_texture"), &PaintCanvas::get_image_texture); + ClassDB::bind_method(D_METHOD("get_preview_image_texture"), &PaintCanvas::get_preview_image_texture); } diff --git a/modules/paint/nodes/paint_canvas.h b/modules/paint/nodes/paint_canvas.h index 5ed1de958..238e37fda 100644 --- a/modules/paint/nodes/paint_canvas.h +++ b/modules/paint/nodes/paint_canvas.h @@ -50,6 +50,12 @@ public: PoolVector2iArray select_same_color(const int p_x, const int p_y); PoolVector2iArray get_neighbouring_pixels(const int pos_x, const int pos_y); + Ref get_image(); + Ref get_preview_image(); + + Ref get_image_texture(); + Ref get_preview_image_texture(); + PaintCanvas(); ~PaintCanvas();