diff options
author | Wagner Scholl Lemos <josephblt@gmail.com> | 2022-02-15 10:25:18 -0300 |
---|---|---|
committer | Wagner Scholl Lemos <josephblt@gmail.com> | 2022-02-15 11:37:41 -0300 |
commit | 160ee4ef8ef804eca5429a98a9359275e096287f (patch) | |
tree | 37a5026d2f6e9607b3b18a71b780819a24a3bea1 /scene/main | |
parent | fdeed6ea061891838cf9b464570141bbf28fc4a0 (diff) |
Added show and hide methods and updated doc API.
Diffstat (limited to 'scene/main')
-rw-r--r-- | scene/main/canvas_layer.cpp | 10 | ||||
-rw-r--r-- | scene/main/canvas_layer.h | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/scene/main/canvas_layer.cpp b/scene/main/canvas_layer.cpp index d4418a3cde..2f7b18a80e 100644 --- a/scene/main/canvas_layer.cpp +++ b/scene/main/canvas_layer.cpp @@ -67,6 +67,14 @@ void CanvasLayer::set_visible(bool p_visible) { } } +void CanvasLayer::show() { + set_visible(true); +} + +void CanvasLayer::hide() { + set_visible(false); +} + bool CanvasLayer::is_visible() const { return visible; } @@ -295,6 +303,8 @@ void CanvasLayer::_bind_methods() { ClassDB::bind_method(D_METHOD("set_visible", "visible"), &CanvasLayer::set_visible); ClassDB::bind_method(D_METHOD("is_visible"), &CanvasLayer::is_visible); + ClassDB::bind_method(D_METHOD("show"), &CanvasLayer::show); + ClassDB::bind_method(D_METHOD("hide"), &CanvasLayer::hide); ClassDB::bind_method(D_METHOD("set_transform", "transform"), &CanvasLayer::set_transform); ClassDB::bind_method(D_METHOD("get_transform"), &CanvasLayer::get_transform); diff --git a/scene/main/canvas_layer.h b/scene/main/canvas_layer.h index b7bd793440..2493675b31 100644 --- a/scene/main/canvas_layer.h +++ b/scene/main/canvas_layer.h @@ -72,6 +72,8 @@ public: void set_visible(bool p_visible); bool is_visible() const; + void show(); + void hide(); void set_transform(const Transform2D &p_xform); Transform2D get_transform() const; |