added get_visible_characters() to Label

This commit is contained in:
Zher Huei Lee 2015-09-07 22:56:16 +01:00
parent 7c5cd0c296
commit a0ba134643
2 changed files with 8 additions and 1 deletions

View file

@ -564,6 +564,11 @@ void Label::set_visible_characters(int p_amount) {
update(); update();
} }
int Label::get_visible_characters() const {
return visible_chars;
}
void Label::set_percent_visible(float p_percent) { void Label::set_percent_visible(float p_percent) {
if (p_percent<0 || p_percent>=1) { 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_height"),&Label::get_line_height);
ObjectTypeDB::bind_method(_MD("get_line_count"),&Label::get_line_count); 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("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("set_percent_visible","percent_visible"),&Label::set_percent_visible);
ObjectTypeDB::bind_method(_MD("get_percent_visible"),&Label::get_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); ObjectTypeDB::bind_method(_MD("set_lines_skipped","lines_skipped"),&Label::set_lines_skipped);

View file

@ -115,6 +115,7 @@ public:
bool is_uppercase() const; bool is_uppercase() const;
void set_visible_characters(int p_amount); void set_visible_characters(int p_amount);
int get_visible_characters() const;
int get_total_character_count() const; int get_total_character_count() const;
void set_clip_text(bool p_clip); void set_clip_text(bool p_clip);