It is possible to export a Dictionary to inspector?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By gcivico
:warning: Old Version Published before Godot 3 was released.

Hi.

There is a way to export a Dictionary type to inspector?

I do this:

export(Dictionary) var Configuration = {
	Time = 1.5
}

But Inspector is not showing Dictionary keys:

If I use an Array export export (Array) var Test, the inspector show the Dictionary option to be selected:

But I can’t set any key/value to the Dictionary:

:bust_in_silhouette: Reply From: Daniel Lewan

According to documentation you cannot export dictionary. I guess you can open github issue about that if you think this would be useful.

:bust_in_silhouette: Reply From: AKashyap86

Hi I also needed to export a dictionary, but what I did was export the array like you did, and then increased the size in the editor, and scrolled to the bottom of the list to find Array, RawArray, IntArray, StringArray Vector2Array, Vector3Array and ColorArray. So essentially it becomes arrays inside an array, which is more or less a dictionary. Did the job for me … !!! Hope it helps you too !!!

But yeah a dictionary would be much better. I hope and I think they have planned for the future, maybe it will be there in v3.0

Hi AKashyap86.

Thanks for the idea !!

gcivico | 2017-08-10 16:26

:bust_in_silhouette: Reply From: gcivico

Hi.

I already opened an issue for this: Edit on Inspector an exported Dictionary