ManiaScript  2019-10-10
The script language used in ManiaPlanet gaming system
Functions
TextLib Namespace Reference

Functions

Real ToReal (Text _Text)
 Returns the Real corresponding to _Text. More...
 
Integer ToInteger (Text _Text)
 Returns the Integer corresponding to _Text. More...
 
Vec3 ToColor (Text _Text)
 Returns the RGB color corresponding to _Text. More...
 
Text SubString (Text _Text, Integer _Start, Integer _Length)
 Returns a substring of _Text. More...
 
Text SubText (Text _Text, Integer _Start, Integer _Length)
 Returns a substring of _Text. More...
 
Integer Length (Text _Text)
 Returns the length of _Text. More...
 
Text ToText (Integer _Integer)
 Returns the Text corresponding to _Integer. More...
 
Text ToText (Real _Real)
 Returns the Text corresponding to _Real. More...
 
Text ToText (Boolean _Boolean)
 Returns the Text corresponding to _Boolean. More...
 
Text ToText (Int3 _Int3)
 Returns the Text corresponding to _Int3. More...
 
Text ToText (Vec3 _Vec3)
 Returns the Text corresponding to _Vec3. More...
 
Text TimeToText (Integer _Time, Boolean _IncludeCentiSeconds)
 Returns the Text corresponding to _Time. More...
 
Text TimeToText (Integer _Time)
 Returns the Text corresponding to _Time. More...
 
Text ColorToText (Vec3 _Color)
 Returns the Text corresponding to _Color. More...
 
Text FormatInteger (Integer Argument1, Integer Argument2)
 
Text FormatReal (Real _Value, Integer _FPartLength, Boolean _HideZeroes, Boolean _HideDot)
 Returns the Text corresponding to a Real. With formatting. More...
 
Text ToUpperCase (Text _TextToChange)
 Changes lower case characters to upper case characters. More...
 
Text ToLowerCase (Text _TextToChange)
 Changes upper case characters to lower case characters. More...
 
Text CloseStyleTags (Text _String)
 Return a string where the previously unclosed $< tags have their $> counterpart. More...
 
Boolean CompareWithoutFormat (Text _Text1, Text _Text2, Boolean _IsCaseSensitive)
 Compares texts without taking format characters in account. More...
 
Boolean Find (Text _TextToFind, Text _TextToSearchIn, Boolean _IsFormatSensitive, Boolean _IsCaseSensitive)
 Returns True if the searched text is found in the text to search in. More...
 
Boolean EndsWith (Text _TextToFind, Text _TextToSearchIn)
 Return True if the Text ends with the TextToFind. More...
 
Boolean EndsWith (Text _TextToFind, Text _TextToSearchIn, Boolean _IsFormatSensitive, Boolean _IsCaseSensitive)
 Return True if the Text ends with the TextToFind. More...
 
Boolean StartsWith (Text _TextToFind, Text _TextToSearchIn)
 Return True if the Text starts with the TextToFind. More...
 
Boolean StartsWith (Text _TextToFind, Text _TextToSearchIn, Boolean _IsFormatSensitive, Boolean _IsCaseSensitive)
 Return True if the Text starts with the TextToFind. More...
 
Text Compose (Text Argument1)
 
Text Compose (Text Argument1, Text Argument2)
 
Text Compose (Text Argument1, Text Argument2, Text Argument3)
 
Text Compose (Text Argument1, Text Argument2, Text Argument3, Text Argument4)
 
Text Compose (Text Argument1, Text Argument2, Text Argument3, Text Argument4, Text Argument5)
 
Text Compose (Text Argument1, Text Argument2, Text Argument3, Text Argument4, Text Argument5, Text Argument6)
 
Text MLEncode (Text Argument1)
 
Text URLEncode (Text Argument1)
 
Text StripFormatting (Text Argument1)
 
Text [VoidSplit (Text _Separators, Text _Text)
 Splits a given text based on a given separators set. More...
 
Text Join (Text _Separator, Text[Void] _Texts)
 Joins a set of texts with the given separator. More...
 
Text Trim (Text Argument1)
 
Text ReplaceChars (Text Argument1, Text Argument2, Text Argument3)
 
Text Replace (Text _Text, Text _ToReplace, Text _Replacement)
 Replaces occurences of _ToReplace in _Text with _Replacement. More...
 
Text [VoidRegexFind (Text _Pattern, Text _Text, Text _Flags)
 Find occurences of the _Pattern in the _Text. More...
 
Text [VoidRegexMatch (Text _Pattern, Text _Text, Text _Flags)
 Captures the groups of the _Pattern in the matching _Text. group[0] is the whole pattern match. More...
 
Text RegexReplace (Text _Pattern, Text _Text, Text _Flags, Text _Replacement)
 Replace the _Pattern in the matching text with _Replacement. More...
 
Text GetTranslatedText (Text _Text)
 Lookup the text in the current translation dictionary. More...
 

Function Documentation

◆ CloseStyleTags()

Text TextLib::CloseStyleTags ( Text  _String)

Return a string where the previously unclosed $< tags have their $> counterpart.

◆ ColorToText()

Text TextLib::ColorToText ( Vec3  _Color)

Returns the Text corresponding to _Color.

Parameters
_Color: The color you want to convert into a text

◆ CompareWithoutFormat()

Boolean TextLib::CompareWithoutFormat ( Text  _Text1,
Text  _Text2,
Boolean  _IsCaseSensitive 
)

Compares texts without taking format characters in account.

Returns True if Text1 and Text2 are equal. Format differences are not taken into account. Case differences are taken into account if IsCaseSensitive is set to True.

◆ Compose() [1/6]

Text TextLib::Compose ( Text  Argument1)

◆ Compose() [2/6]

Text TextLib::Compose ( Text  Argument1,
Text  Argument2 
)

◆ Compose() [3/6]

Text TextLib::Compose ( Text  Argument1,
Text  Argument2,
Text  Argument3 
)

◆ Compose() [4/6]

Text TextLib::Compose ( Text  Argument1,
Text  Argument2,
Text  Argument3,
Text  Argument4 
)

◆ Compose() [5/6]

Text TextLib::Compose ( Text  Argument1,
Text  Argument2,
Text  Argument3,
Text  Argument4,
Text  Argument5 
)

◆ Compose() [6/6]

Text TextLib::Compose ( Text  Argument1,
Text  Argument2,
Text  Argument3,
Text  Argument4,
Text  Argument5,
Text  Argument6 
)

◆ EndsWith() [1/2]

Boolean TextLib::EndsWith ( Text  _TextToFind,
Text  _TextToSearchIn 
)

Return True if the Text ends with the TextToFind.

Parameters
_TextToFind: The text you are looking for
_TextToSearchIn: The text you are searching in

◆ EndsWith() [2/2]

Boolean TextLib::EndsWith ( Text  _TextToFind,
Text  _TextToSearchIn,
Boolean  _IsFormatSensitive,
Boolean  _IsCaseSensitive 
)

Return True if the Text ends with the TextToFind.

Parameters
_TextToFind: The text you are looking for
_TextToSearchIn: The text you are searching in
_IsFormatSensitive: True if you want to take Format into account, False elseway
_IsCaseSensitive: True if you want to take Case into account, False elseway

◆ Find()

Boolean TextLib::Find ( Text  _TextToFind,
Text  _TextToSearchIn,
Boolean  _IsFormatSensitive,
Boolean  _IsCaseSensitive 
)

Returns True if the searched text is found in the text to search in.

Format is not taken into account if IsFormatSensitive is set to False. Case is not taken into account if IsCaseSensitive is set to False.

Parameters
_TextToFind: The text you are looking for
_TextToSearchIn: The text you are searching in
_IsFormatSensitive: True if you want to take Format into account, False elseway
_IsCaseSensitive: True if you want to take Case into account, False elseway

◆ FormatInteger()

Text TextLib::FormatInteger ( Integer  Argument1,
Integer  Argument2 
)

◆ FormatReal()

Text TextLib::FormatReal ( Real  _Value,
Integer  _FPartLength,
Boolean  _HideZeroes,
Boolean  _HideDot 
)

Returns the Text corresponding to a Real. With formatting.

Parameters
_Value: The Real value you want to convert
_FPartLength: The number of digits you want for the FPart
_HideZeroes: Hide trailing zeroes
_HideDot: Hide trailing dot if there is nothing after it

◆ GetTranslatedText()

Text TextLib::GetTranslatedText ( Text  _Text)

Lookup the text in the current translation dictionary.

Lookup the text in the current translation dictionary, and returns the translation, or returns the original text if not found.

◆ Join()

Text TextLib::Join ( Text  _Separator,
Text  _Texts[Void] 
)

Joins a set of texts with the given separator.

Parameters
_Separator: The separator to use
_Texts: The texts to join.

◆ Length()

Integer TextLib::Length ( Text  _Text)

Returns the length of _Text.

Parameters
_Text: The text you want the length

◆ MLEncode()

Text TextLib::MLEncode ( Text  Argument1)

◆ RegexFind()

Text [Void] TextLib::RegexFind ( Text  _Pattern,
Text  _Text,
Text  _Flags 
)

Find occurences of the _Pattern in the _Text.

Parameters
_Pattern: Pattern is a regular expression, similar to javascript syntax.
_Text:
_Flags: Flags can be 'g' to find all occurences, 'i' to ignore case, 'm' for multiline mode.

◆ RegexMatch()

Text [Void] TextLib::RegexMatch ( Text  _Pattern,
Text  _Text,
Text  _Flags 
)

Captures the groups of the _Pattern in the matching _Text. group[0] is the whole pattern match.

Parameters
_Pattern: Pattern is a regular expression, similar to javascript syntax.
_Text:
_Flags: Flags can be 'i' to ignore case, 'm' for multiline mode.

◆ RegexReplace()

Text TextLib::RegexReplace ( Text  _Pattern,
Text  _Text,
Text  _Flags,
Text  _Replacement 
)

Replace the _Pattern in the matching text with _Replacement.

Parameters
_Pattern: Pattern is a regular expression, similar to javascript syntax.
_Text:
_Flags: Flags can be 'g' to find all occurences, 'i' to ignore case, 'm' for multiline mode.
_Replacement:

◆ Replace()

Text TextLib::Replace ( Text  _Text,
Text  _ToReplace,
Text  _Replacement 
)

Replaces occurences of _ToReplace in _Text with _Replacement.

Parameters
_Text: The text you search in
_ToReplace: The text you want to replace
_Replacement: The text you want to insert

◆ ReplaceChars()

Text TextLib::ReplaceChars ( Text  Argument1,
Text  Argument2,
Text  Argument3 
)

◆ Split()

Text [Void] TextLib::Split ( Text  _Separators,
Text  _Text 
)

Splits a given text based on a given separators set.

Parameters
_Separators: The separators to use
_Text: The text to split.

◆ StartsWith() [1/2]

Boolean TextLib::StartsWith ( Text  _TextToFind,
Text  _TextToSearchIn 
)

Return True if the Text starts with the TextToFind.

Parameters
_TextToFind: The text you are looking for
_TextToSearchIn: The text you are searching in

◆ StartsWith() [2/2]

Boolean TextLib::StartsWith ( Text  _TextToFind,
Text  _TextToSearchIn,
Boolean  _IsFormatSensitive,
Boolean  _IsCaseSensitive 
)

Return True if the Text starts with the TextToFind.

Parameters
_TextToFind: The text you are looking for
_TextToSearchIn: The text you are searching in
_IsFormatSensitive: True if you want to take Format into account, False elseway
_IsCaseSensitive: True if you want to take Case into account, False elseway

◆ StripFormatting()

Text TextLib::StripFormatting ( Text  Argument1)

◆ SubString()

Text TextLib::SubString ( Text  _Text,
Integer  _Start,
Integer  _Length 
)

Returns a substring of _Text.

Returns the substring of _Text beginning at the _Start index, with a length of _Length chars Returns an empty Text if _Start > Text.Length or _Length == 0

Parameters
_Text: The text in which we look for the substring
_Start: The beginning index of the substring
_Length: The length of the substring

◆ SubText()

Text TextLib::SubText ( Text  _Text,
Integer  _Start,
Integer  _Length 
)

Returns a substring of _Text.

Returns the substring of _Text beginning at the _Start index, with a length of _Length chars Returns an empty Text if _Start > Text.Length or _Length == 0

Parameters
_Text: The text in which we look for the substring
_Start: The beginning index of the substring
_Length: The length of the substring

◆ TimeToText() [1/2]

Text TextLib::TimeToText ( Integer  _Time,
Boolean  _IncludeCentiSeconds 
)

Returns the Text corresponding to _Time.

Converts a _Time Integer to a Text with the following format :

  • MmSsCc if IncludeCentiSeconds is set to true

MmSs if IncludeCentiSeconds is set to false

Parameters
_Time: The time you want to convert into a Text
_IncludeCentiSeconds: Set IncludeCentiSeconds to True if you wants the CentiSeconds to be displayed in the returned Text

◆ TimeToText() [2/2]

Text TextLib::TimeToText ( Integer  _Time)

Returns the Text corresponding to _Time.

Converts the _Time Integer to a Text with the following format : MmSs

Parameters
_Time: The time you want to convert into a Text

◆ ToColor()

Vec3 TextLib::ToColor ( Text  _Text)

Returns the RGB color corresponding to _Text.

Returns an empty Vec3 if an invalid Text is given

Parameters
_Text: The text you want to convert into a RGB color

◆ ToInteger()

Integer TextLib::ToInteger ( Text  _Text)

Returns the Integer corresponding to _Text.

Returns -1 if an invalid Text is given

Parameters
_Text: The text you want to convert into an Integer

◆ ToLowerCase()

Text TextLib::ToLowerCase ( Text  _TextToChange)

Changes upper case characters to lower case characters.

◆ ToReal()

Real TextLib::ToReal ( Text  _Text)

Returns the Real corresponding to _Text.

Returns -1 if an invalid Text is given

Parameters
_Text: The text you want to convert into a Real

◆ ToText() [1/5]

Text TextLib::ToText ( Integer  _Integer)

Returns the Text corresponding to _Integer.

Parameters
_Integer: The Integer you want to convert

◆ ToText() [2/5]

Text TextLib::ToText ( Real  _Real)

Returns the Text corresponding to _Real.

Parameters
_Real: The Real you want to convert

◆ ToText() [3/5]

Text TextLib::ToText ( Boolean  _Boolean)

Returns the Text corresponding to _Boolean.

Parameters
_Boolean: The Boolean you want to convert

◆ ToText() [4/5]

Text TextLib::ToText ( Int3  _Int3)

Returns the Text corresponding to _Int3.

Parameters
_Int3: The Int3 you want to convert

◆ ToText() [5/5]

Text TextLib::ToText ( Vec3  _Vec3)

Returns the Text corresponding to _Vec3.

Parameters
_Vec3: The Vec3 you want to convert

◆ ToUpperCase()

Text TextLib::ToUpperCase ( Text  _TextToChange)

Changes lower case characters to upper case characters.

◆ Trim()

Text TextLib::Trim ( Text  Argument1)

◆ URLEncode()

Text TextLib::URLEncode ( Text  Argument1)