godot

Haxe/C# externs for Godot


Keywords
3d, cs, extern, game, godot, haxe, haxelib
License
MIT
Install
haxelib install godot 3.3.0

Documentation

haxe externs | editor plugin | demo | api doc | discussions

CI Haxelib Version Haxelib Downloads Haxelib License

Haxe/C# externs for Godot 3.3.0

Use the Godot engine with Haxe scripting, using the Haxe/C# target.

Using the editor plugin plugin is recommended, see the documentation on how to install it, setup a project, using Haxe scripts and building your project.

Godot will show many warnings about the Haxe generated C# code, this is because of https://github.com/godotengine/godot/issues/28293.

Differences with the C# API

  • Casing
    • Variables and functions use the camelCase formating instead of C#'s PascalCase
    • Enums and types still use PascalCase
    • Constants use ALL_CAPS
    • Due to Haxe's module handling C# subtypes like Godot.Animation.InterpolationType are godot.Animation_InterpolationType
  • Export meta for variables is @:export, C# is [Export]
  • Haxe has different keywords than C#, if the C# API use an Haxe keyword it'll be suffixed with a _
  • Typesafe signals with lambda support, for improved safety and dce support
    • signal_name become a onSignalName variable of type Signal with connect/disconnect/isConnected functions
    • Replace mynode.connect("the_signal", myHandler, "myFunction") with mynode.onTheSignal.connect(myHandler.myFunction)

TODOs

  • Mark deprecated functions
  • Array access on Vector2, Vector3, Transform, Transform2D, Quat, Color and Basis
  • Missing types Godot.DynamicGodotObject and Godot.MarshalUtils
  • Explicit constructors
  • Function with type parameters on PackedScene.Instance, PackedScene.InstanceOrNull
  • cs.system.EventHandler_1 on GD.UnhandledException

License

The generated externs and support code are MIT licensed, the original C# externs and the Godot engine are MIT licensed.