Implement get_escape()

This commit is contained in:
JeremyStar™ 2024-05-07 21:34:00 +02:00
parent 14b5989f26
commit 15ec1073b6
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D
2 changed files with 6 additions and 0 deletions

View file

@ -55,6 +55,8 @@ Converts an array into a string array.
If an item is found that is not of type `String`, an empty array is returned.
### *Array* <u>stringarray_to_array</u>(*Array[String]* array)
Converts a string array into an array.
### *String* <u>get_escape</u>()
Returns \ so you can (for example) print ANSI codes, which isn't normally possible because of GDScript restrictions.
### *Vector2* <u>get_center</u>(*Vector2* <u>parent_size</u>, *Vector2* <u>child_size</u>)
Calculates the center of the child in the area of the parent.

View file

@ -123,6 +123,10 @@ func stringarray_to_array(array: Array[String]) -> Array:
return output
# +++ etc +++
## Returns \ so you can (for example) print ANSI codes, which isn't normally possible because of GDScript restrictions.
func get_escape() -> String:
return PackedByteArray([0x1b]).get_string_from_ascii()
## Calculates the center of the child in the area of the parent.[br]
## [br]
## Example: