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(); }
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(); } }