godotjs / javascript

Javascript binding for godotengine
https://godotjs.github.io/
MIT License
980 stars 82 forks source link

Custom Resources through ECMAScript #124

Open mageowl opened 2 years ago

mageowl commented 2 years ago

Currently, Godot will not recognize custom resource classes written in JS/TS.

mageowl commented 2 years ago

does anyone have a solution/workaround besides using gd script and a ts interface?

nmerget commented 1 year ago

I hope I understand the issue. I used this tutorial to reproduce what I think you want to do.

The main point is that you need to use @properties for @export like this.

I had to use TYPE_OBJECT to drag&drop the resource in the editor like this