haxe externs | editor plugin | demo | api doc | discussions
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
aregodot.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 aonSignalName
variable of typeSignal
withconnect
/disconnect
/isConnected
functions - Replace
mynode.connect("the_signal", myHandler, "myFunction")
withmynode.onTheSignal.connect(myHandler.myFunction)
-
TODOs
- Mark deprecated functions
- Array access on
Vector2
,Vector3
,Transform
,Transform2D
,Quat
,Color
andBasis
- Missing types
Godot.DynamicGodotObject
andGodot.MarshalUtils
- Explicit constructors
- Function with type parameters on
PackedScene.Instance
,PackedScene.InstanceOrNull
-
cs.system.EventHandler_1
onGD.UnhandledException
License
The generated externs and support code are MIT licensed, the original C# externs and the Godot engine are MIT licensed.