示例#1
0
void Label::set_percent_visible(float p_percent) {

	if (p_percent<0 || p_percent>=1) {

		visible_chars=-1;
		percent_visible=1;

	} else {

		visible_chars=get_total_character_count()*p_percent;
		percent_visible=p_percent;

	}
	update();

}
示例#2
0
文件: label.cpp 项目: SPTelur/godot
void Label::set_text(const String& p_string) {

	String str = XL_MESSAGE(p_string);

	if (text==str)
		return;

	text=str;
	word_cache_dirty=true;
	if (percent_visible<1)
		visible_chars=get_total_character_count()*percent_visible;
	update();
	if (!autowrap) {
		minimum_size_changed();
	}

}