- Download Haxe (preferably the recent preview build, but 3.4.7 should work too)
- Download an IDE with Haxe support (list)
If you're on Windows, FlashDevelop/HaxeDevelop is usually the best bet.
Install sfhx and sfgml libraries from the downloaded package.
To do so, use haxelib's dev command to set paths to both libraries
haxelib dev sfhx <downloaded directory>/sfhx/sfhx-dev haxelib dev sfgml <downloaded directory>/sfgml/sfgml-dev
If you install the package from itch.io app, you can set this to itch subdirectory to have the libraries auto-update.
You can also just copy the sfgml/sfhx directories to Haxe's lib directory (when updating, probably remove the old copies first).
- Add a new extension to your project (right-click on Extensions section) and add a blank GML file to it. The extension and it's file can be named anyhow.
- If using FlashDevelop/HaxeDevelop, create a Haxe - JavaScript project, open menu:Project - Properties, and set Output File to point to the earlier made extension's file (.yy / .extension.gmx). Then add ._ suffix to the path to prevent the file from being overwritten by Haxe compiler. So your Output File path might look like so on GMS1
testgml.gmx\extensions\Main.extension.gmx._
and like so on GMS2
testgml\extensions\Main\Main.yy._
Then switch to Compiler Options tab, and add the following Additional Compiler Options:
-dce full
And add the folowing to Libraries:
sfhx sfgml
If targetting GMS2, add the following to Directives:
sfgml-next
Directives is also where you add your option=value pairs for toggling things from Compiler directives section.
- If not using FlashDevelop, build your project like
haxe -debug -lib sfhx -lib sfgml -cp SourceDirectory -js ExtensionPath._ -main MainClass -dce full
and add any additional -D directives (e.g. -D sfgml-next) in there.
- Upon compiling the Haxe project, the GML extension in the GM project will be updated with new code, and you'll be able to use it's functions.