-
I would like to create a GDictionnary and add some values to it, but I don't find any "good" method to do so. // Workaround
const dragData = new GDictionary();
dragData.get_or_add('item', this);
dragData.get_or_add('origin', this.get_parent()); |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Beta Was this translation helpful? Give feedback.
-
@G159w I've submitted a PR which introduces a .proxy() method on Please let me know if it achieves what you want. You'd use it like: const dragData = new GDictionary().proxy();
dragData.item = this;
dragData.origin = this.get_parent(); |
Beta Was this translation helpful? Give feedback.
data.set_keyed(xxx, val)
anddata.get_keyed(xxx)
can be used as an alternative todata[xxx] = val
andval = data[xxx]
in gdscript.