0 votes

I do not understand how I can handle RawArrays.

in Engine by (193 points)

What do you want to do with them?

I wanted to convert RawArray to other types and the opposite also, type a string in a RawArray an int in a RawArray

1 Answer

+1 vote
Best answer

You can convert a String to RawArray using the toascii or toutf8 methods of String, and you can convert RawArray to String using the getstringfromascii and getstringfromutf8 methods of RawArray.

There is no built-in way to convert between int and RawArray. You could calculate the bytes manually but it would be exceptionally inefficient because you will be doing heavy arithmetic in GDScript.

by (238 points)
selected by

Converting to string is already fine, because there I only convert the string to int, thank you.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.