What is Haxe?
Check out some of these features here.
- Autogenerated bindings for every Library and Type in StarfallEx.
- IDE Documentation so you don't have to get out of your editor to find out what a function does.
- Some support for replacing Haxe standard library with sf friendly methods.
What would you use this for?
- If you want typed, more powerful & easier to manage code.
- If you don't want your source code to be stolen, this works as well since the source is transpiled into unrecognizable lua.
- If you wanted to use all of Haxe's public libraries (see lib.haxe.org), which a good portion should be compatible with SFHaxe.
- Get Haxe (Version must be > 4.2.0)
- Install using Haxe's package manager haxelib:
haxelib install sfhaxe
- That's it!
Look at examples/Basic Full for a full example.
Make a Haxe project, and in your
build.hxml file add:
# Optional: Delete Unused Code --dce full # Link to sfhaxe. --library sfhaxe # Example Defines --define SERVER # Can be SERVER, CLIENT or SHARED --define NAME=A cool chip --define SUPERUSER --define AUTHOR=Vurv --define MODEL=a/model/path.mdl # Set the Haxe path to the current directory of the hxml + /src/ --class-path src # Tell the compiler to generate lua code at this path local to %CD% --lua bin/outscript.lua # Set the main class to compile from. In this case, you have a file called Main.hx in /src/ that creates class Main. --main Main
If you want Haxe bindings for GLua to make addons instead of Starfall scripts, check out gmodhaxe. (Not made by me so can't confirm how good it is)