allow to have char type and ASCII strings in GDScript #5016
Replies: 3 comments
-
There's PackedByteArray (PoolByteArray in 3.x), which you can use for this purpose. It's limited to storing ASCII text only, so it's not very friendly in an age of Unicode and internationalization. That said, it's unlikely that memory usage will ever be a limiting factor when writing game logic. |
Beta Was this translation helpful? Give feedback.
-
I can see 8-bit Strings potentially being useful internally (for example I see lot of names in the ClassDB already use just a few letters and characters to be identified anyway), but I feel like for the average Godot user exposing something like this wouldn't be necessary, nowadays at least. |
Beta Was this translation helpful? Give feedback.
-
You can use |
Beta Was this translation helpful? Give feedback.
-
GDScript has no char fundamental type:
var letter: char = 'c'
Also has no 1-byte (8-bit) strings, for economical text.
Probably if such are needed, it is expected to have them by using another lang that supports them.
However what do you think?
Would you prefer have them for being able to use only GDScript as much as possible, or find it unnecessary?
Beta Was this translation helpful? Give feedback.
All reactions