feat: modules moved and engine moved to submodule
This commit is contained in:
parent
dfb5e645cd
commit
c33d2130cc
5136 changed files with 225275 additions and 64485 deletions
|
|
@ -35,6 +35,7 @@ void TextParagraph::_bind_methods() {
|
|||
|
||||
ClassDB::bind_method(D_METHOD("set_direction", "direction"), &TextParagraph::set_direction);
|
||||
ClassDB::bind_method(D_METHOD("get_direction"), &TextParagraph::get_direction);
|
||||
ClassDB::bind_method(D_METHOD("get_inferred_direction"), &TextParagraph::get_inferred_direction);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "direction", PROPERTY_HINT_ENUM, "Auto,Light-to-right,Right-to-left"), "set_direction", "get_direction");
|
||||
|
||||
|
|
@ -87,7 +88,7 @@ void TextParagraph::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("set_text_overrun_behavior", "overrun_behavior"), &TextParagraph::set_text_overrun_behavior);
|
||||
ClassDB::bind_method(D_METHOD("get_text_overrun_behavior"), &TextParagraph::get_text_overrun_behavior);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "text_overrun_behavior", PROPERTY_HINT_ENUM, "Trim Nothing,Trim Characters,Trim Words,Ellipsis,Word Ellipsis"), "set_text_overrun_behavior", "get_text_overrun_behavior");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "text_overrun_behavior", PROPERTY_HINT_ENUM, "Trim Nothing,Trim Characters,Trim Words,Ellipsis (6+ Characters),Word Ellipsis (6+ Characters),Ellipsis (Always),Word Ellipsis (Always)"), "set_text_overrun_behavior", "get_text_overrun_behavior");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_ellipsis_char", "char"), &TextParagraph::set_ellipsis_char);
|
||||
ClassDB::bind_method(D_METHOD("get_ellipsis_char"), &TextParagraph::get_ellipsis_char);
|
||||
|
|
@ -105,6 +106,8 @@ void TextParagraph::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("get_line_rid", "line"), &TextParagraph::get_line_rid);
|
||||
ClassDB::bind_method(D_METHOD("get_dropcap_rid"), &TextParagraph::get_dropcap_rid);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_range"), &TextParagraph::get_range);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_line_count"), &TextParagraph::get_line_count);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_max_lines_visible", "max_lines_visible"), &TextParagraph::set_max_lines_visible);
|
||||
|
|
@ -213,6 +216,17 @@ void TextParagraph::_shape_lines() const {
|
|||
BitField<TextServer::TextOverrunFlag> overrun_flags = TextServer::OVERRUN_NO_TRIM;
|
||||
if (overrun_behavior != TextServer::OVERRUN_NO_TRIMMING) {
|
||||
switch (overrun_behavior) {
|
||||
case TextServer::OVERRUN_TRIM_WORD_ELLIPSIS_FORCE: {
|
||||
overrun_flags.set_flag(TextServer::OVERRUN_TRIM);
|
||||
overrun_flags.set_flag(TextServer::OVERRUN_TRIM_WORD_ONLY);
|
||||
overrun_flags.set_flag(TextServer::OVERRUN_ADD_ELLIPSIS);
|
||||
overrun_flags.set_flag(TextServer::OVERRUN_ENFORCE_ELLIPSIS);
|
||||
} break;
|
||||
case TextServer::OVERRUN_TRIM_ELLIPSIS_FORCE: {
|
||||
overrun_flags.set_flag(TextServer::OVERRUN_TRIM);
|
||||
overrun_flags.set_flag(TextServer::OVERRUN_ADD_ELLIPSIS);
|
||||
overrun_flags.set_flag(TextServer::OVERRUN_ENFORCE_ELLIPSIS);
|
||||
} break;
|
||||
case TextServer::OVERRUN_TRIM_WORD_ELLIPSIS:
|
||||
overrun_flags.set_flag(TextServer::OVERRUN_TRIM);
|
||||
overrun_flags.set_flag(TextServer::OVERRUN_TRIM_WORD_ONLY);
|
||||
|
|
@ -379,6 +393,13 @@ TextServer::Direction TextParagraph::get_direction() const {
|
|||
return TS->shaped_text_get_direction(rid);
|
||||
}
|
||||
|
||||
TextServer::Direction TextParagraph::get_inferred_direction() const {
|
||||
_THREAD_SAFE_METHOD_
|
||||
|
||||
const_cast<TextParagraph *>(this)->_shape_lines();
|
||||
return TS->shaped_text_get_inferred_direction(rid);
|
||||
}
|
||||
|
||||
void TextParagraph::set_custom_punctuation(const String &p_punct) {
|
||||
_THREAD_SAFE_METHOD_
|
||||
|
||||
|
|
@ -604,6 +625,12 @@ Size2 TextParagraph::get_size() const {
|
|||
return size;
|
||||
}
|
||||
|
||||
Vector2i TextParagraph::get_range() const {
|
||||
_THREAD_SAFE_METHOD_
|
||||
|
||||
return TS->shaped_text_get_range(rid);
|
||||
}
|
||||
|
||||
int TextParagraph::get_line_count() const {
|
||||
_THREAD_SAFE_METHOD_
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue