unreal.TextLibrary
¶
- class unreal.TextLibrary(outer=None, name='None')¶
Bases:
unreal.BlueprintFunctionLibrary
Kismet Text Library
C++ Source:
Module: Engine
File: KismetTextLibrary.h
- classmethod as_currency_base(base_value, currency_code) → Text¶
Generate an FText that represents the passed number as currency in the current culture. BaseVal is specified in the smallest fractional value of the currency and will be converted for formatting according to the selected culture. Keep in mind the CurrencyCode is completely independent of the culture it’s displayed in (and they do not imply one another). For example: FText::AsCurrencyBase(650, TEXT(“EUR”)); would return an FText of “<EUR>6.50” in most English cultures (en_US/en_UK) and “6,50<EUR>” in Spanish (es_ES) (where <EUR> is U+20AC)
- classmethod as_currency_float(value, rounding_mode, always_sign=False, use_grouping=True, minimum_integral_digits=1, maximum_integral_digits=324, minimum_fractional_digits=0, maximum_fractional_digits=3, currency_code='') → Text¶
Converts a passed in float to a text formatted as a currency
- classmethod as_currency_integer(value, rounding_mode, always_sign=False, use_grouping=True, minimum_integral_digits=1, maximum_integral_digits=324, minimum_fractional_digits=0, maximum_fractional_digits=3, currency_code='') → Text¶
Converts a passed in integer to a text formatted as a currency
- Parameters
value (int32) –
rounding_mode (RoundingMode) –
always_sign (bool) –
use_grouping (bool) –
minimum_integral_digits (int32) –
maximum_integral_digits (int32) –
minimum_fractional_digits (int32) –
maximum_fractional_digits (int32) –
currency_code (str) –
- Returns
- Return type
- classmethod as_date_date_time(date_time) → Text¶
Converts a passed in date & time to a text, formatted as a date using an invariant timezone. This will use the given date & time as-is, so it’s assumed to already be in the correct timezone.
- classmethod as_date_time_date_time(in_) → Text¶
Converts a passed in date & time to a text, formatted as a date & time using an invariant timezone. This will use the given date & time as-is, so it’s assumed to already be in the correct timezone.
- classmethod as_percent_float(value, rounding_mode, always_sign=False, use_grouping=True, minimum_integral_digits=1, maximum_integral_digits=324, minimum_fractional_digits=0, maximum_fractional_digits=3) → Text¶
Converts a passed in float to a text, formatted as a percent
- Parameters
value (float) –
rounding_mode (RoundingMode) –
always_sign (bool) –
use_grouping (bool) –
minimum_integral_digits (int32) –
maximum_integral_digits (int32) –
minimum_fractional_digits (int32) –
maximum_fractional_digits (int32) –
- Returns
- Return type
- classmethod as_time_date_time(in_) → Text¶
Converts a passed in date & time to a text, formatted as a time using an invariant timezone. This will use the given date & time as-is, so it’s assumed to already be in the correct timezone.
- classmethod as_time_zone_date_date_time(date_time, time_zone='') → Text¶
Converts a passed in date & time to a text, formatted as a date using the given timezone (default is the local timezone). This will convert the given date & time from UTC to the given timezone (taking into account DST).
- classmethod as_time_zone_date_time_date_time(date_time, time_zone='') → Text¶
Converts a passed in date & time to a text, formatted as a date & time using the given timezone (default is the local timezone). This will convert the given date & time from UTC to the given timezone (taking into account DST).
- classmethod as_time_zone_time_date_time(date_time, time_zone='') → Text¶
Converts a passed in date & time to a text, formatted as a time using the given timezone (default is the local timezone). This will convert the given date & time from UTC to the given timezone (taking into account DST).
- classmethod as_timespan_timespan(timespan) → Text¶
Converts a passed in time span to a text, formatted as a time span
- classmethod conv_bool_to_text(bool) → Text¶
Converts a boolean value to formatted text, either ‘true’ or ‘false’
- classmethod conv_byte_to_text(value) → Text¶
Converts a byte value to formatted text
- Parameters
value (uint8) –
- Returns
- Return type
- classmethod conv_color_to_text(color) → Text¶
Converts a linear color value to localized formatted text, in the form ‘(R=,G=,B=,A=)’
- Parameters
color (LinearColor) –
- Returns
- Return type
- classmethod conv_float_to_text(value, rounding_mode, always_sign=False, use_grouping=True, minimum_integral_digits=1, maximum_integral_digits=324, minimum_fractional_digits=0, maximum_fractional_digits=3) → Text¶
Converts a passed in float to text based on formatting options
- Parameters
value (float) –
rounding_mode (RoundingMode) –
always_sign (bool) –
use_grouping (bool) –
minimum_integral_digits (int32) –
maximum_integral_digits (int32) –
minimum_fractional_digits (int32) –
maximum_fractional_digits (int32) –
- Returns
- Return type
- classmethod conv_int64_to_text(value, always_sign=False, use_grouping=True, minimum_integral_digits=1, maximum_integral_digits=324) → Text¶
Converts a passed in integer to text based on formatting options
- classmethod conv_int_to_text(value, always_sign=False, use_grouping=True, minimum_integral_digits=1, maximum_integral_digits=324) → Text¶
Converts a passed in integer to text based on formatting options
- classmethod conv_object_to_text(obj) → Text¶
Converts a UObject value to culture invariant text by calling the object’s GetName method
- classmethod conv_rotator_to_text(rot) → Text¶
Converts a rotator value to localized formatted text, in the form ‘P= Y= R=’
- classmethod conv_string_to_text(string) → Text¶
Converts string to culture invariant text. Use Format or Make Literal Text to create localizable text
- classmethod conv_transform_to_text(trans) → Text¶
Converts a transform value to localized formatted text, in the form ‘Translation: X= Y= Z= Rotation: P= Y= R= Scale: X= Y= Z=’
- classmethod conv_vector2d_to_text(vec) → Text¶
Converts a vector2d value to localized formatted text, in the form ‘X= Y=’
- classmethod conv_vector_to_text(vec) → Text¶
Converts a vector value to localized formatted text, in the form ‘X= Y= Z=’
- classmethod equal_equal_ignore_case_text_text(a, b) → bool¶
Returns true if A and B are linguistically equal (A == B), ignoring case.
- classmethod equal_equal_text_text(a, b) → bool¶
Returns true if A and B are linguistically equal (A == B).
- classmethod find_text_in_localization_table(namespace, key) → Text or None¶
Attempts to find existing Text using the representation found in the loc tables for the specified namespace and key.
- classmethod is_polyglot_data_valid(polyglot_data) -> (is_valid=bool, error_message=Text)¶
Check whether the given polyglot data is valid.
- Parameters
polyglot_data (PolyglotTextData) –
- Returns
is_valid (bool):
error_message (Text):
- Return type
tuple
- classmethod not_equal_ignore_case_text_text(a, b) → bool¶
Returns true if A and B are linguistically not equal (A != B), ignoring case.
- classmethod not_equal_text_text(a, b) → bool¶
Returns true if A and B are linguistically not equal (A != B).
- classmethod polyglot_data_to_text(polyglot_data) → Text¶
Get the text instance created from this polyglot data.
- Parameters
polyglot_data (PolyglotTextData) –
- Returns
The text instance, or an empty text if the data is invalid.
- Return type
- classmethod string_table_id_and_key_from_text(text) → (out_table_id=Name, out_key=str) or None¶
Attempts to find the String Table ID and key used by the given text.
- classmethod text_from_string_table(table_id, key) → Text¶
Attempts to create a text instance from a string table ID and key. note: This exists to allow programmatic look-up of a string table entry from dynamic content - you should favor setting your string table reference on a text property or pin wherever possible as it is significantly more robust (see “Make Literal Text”).
- classmethod text_is_from_string_table(text) → bool¶
Returns true if the given text is referencing a string table.
- classmethod text_to_lower(text) → Text¶
Transforms the text to lowercase in a culture correct way. note: The returned instance is linked to the original and will be rebuilt if the active culture is changed.
- classmethod text_to_upper(text) → Text¶
Transforms the text to uppercase in a culture correct way. note: The returned instance is linked to the original and will be rebuilt if the active culture is changed.
- classmethod text_trim_preceding(text) → Text¶
Removes whitespace characters from the front of the text.