This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

I do not understand how I can handle RawArrays.

in Engine by (203 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 (239 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 Frequently asked questions and 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 [email protected] with your username.