summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorZher Huei Lee <lee.zh.92@gmail.com>2015-09-07 22:56:16 +0100
committerZher Huei Lee <lee.zh.92@gmail.com>2015-09-07 22:56:16 +0100
commita0ba13464362c286915f6a83702957668a50b62a (patch)
tree49156baadc0319579eef120b10b5073130bfa553 /scene/gui
parent7c5cd0c2966b678b5fd450bd4910a8fe071fd999 (diff)
added get_visible_characters() to Label
Diffstat (limited to 'scene/gui')
-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);