summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scene/gui/label.cpp8
-rw-r--r--scene/gui/label.h1
2 files changed, 8 insertions, 1 deletions
diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp
index 14e329ec1c..a20e8194ba 100644
--- a/scene/gui/label.cpp
+++ b/scene/gui/label.cpp
@@ -564,6 +564,11 @@ void Label::set_visible_characters(int p_amount) {
update();
}
+int Label::get_visible_characters() const {
+
+ return visible_chars;
+}
+
void Label::set_percent_visible(float p_percent) {
if (p_percent<0 || p_percent>=1) {
@@ -631,7 +636,8 @@ void Label::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_line_height"),&Label::get_line_height);
ObjectTypeDB::bind_method(_MD("get_line_count"),&Label::get_line_count);
ObjectTypeDB::bind_method(_MD("get_total_character_count"),&Label::get_total_character_count);
- ObjectTypeDB::bind_method(_MD("set_visible_characters"),&Label::set_visible_characters);
+ ObjectTypeDB::bind_method(_MD("set_visible_characters","amount"),&Label::set_visible_characters);
+ ObjectTypeDB::bind_method(_MD("get_visible_characters"),&Label::get_visible_characters);
ObjectTypeDB::bind_method(_MD("set_percent_visible","percent_visible"),&Label::set_percent_visible);
ObjectTypeDB::bind_method(_MD("get_percent_visible"),&Label::get_percent_visible);
ObjectTypeDB::bind_method(_MD("set_lines_skipped","lines_skipped"),&Label::set_lines_skipped);
diff --git a/scene/gui/label.h b/scene/gui/label.h
index dc2d4c01e2..4ea9f5d377 100644
--- a/scene/gui/label.h
+++ b/scene/gui/label.h
@@ -115,6 +115,7 @@ public:
bool is_uppercase() const;
void set_visible_characters(int p_amount);
+ int get_visible_characters() const;
int get_total_character_count() const;
void set_clip_text(bool p_clip);