
G
Publisher
godothub
Gype
Tools
JavaScript TypeScript GDScript Callable Button Label Development Examples
Godot with JavaScript/TypeScript
This plugin has been mirrored from the Godot Asset Library.
The plugin author is in no way affiliated with Gadget.
If you are the author of this plugin and would like this mirror removed, please contact support@gadgetgodot.com.
GypeScript
Godot with Great JavaScript/TypeScript
Quick Start
Import the plugin in a Godot project and use it like GDS:
import { Button } from "@godot/classes/button";
import { GodotClass } from "@godot/core/class_defined";
import { Label } from "@godot/classes/label";
@GodotClass
export class ClickGype extends Button {
#label?: Label;
#count = 0;
public _ready(): void {
this.#label = this.get_node("../Label");
this.pressed.connect(new Callable(this, this.add_count));
}
public add_count() {
this.#label!.text = (this.#count++).toString();
}
public _process(delta: number): void {
}
}
Examples can be viewed in the example
directory.
The source repository does not contain compiled binaries, so the addons directory needs to import the plugin itself.
Notes:
- Godot's
variant
types are globally scoped and can be used withoutimport
. - Godot's
object
classes are all ingodot/classes/xxxx
, such asgodot/classes/node
. - Godot's utility functions are in the
GD
singleton, e.g.GD.print()
.
Project Plan
- ✅ Run a JS/TS script
- ✅ Add JS/TS bindings for Godot API
- 🟦 Implement new version of GMUI with JS/TS binding
- 🟨 Add editor support for JS/TS
- 🟦🟨✅...
Build the Project
Compiler Setup
On Linux, you can run it directly without manually configuring GCC.
On Windows, download mingw64 (posix version) and set the PATH env variable.
Build library
Windows: ./build.ps1