Duality is a 2D game engine with an extensible editor (If you follow my blog you’ll see it mention it a few times), I added F# Scripting support a good while ago but I haven’t been posting too much about it, I probably should change that.
Scripting is not the only way to use F# on this engine, you can also create components with F# and it’s pretty simple.
When you run Duality on a folder that has no Data, it creates a solution for plugins by default in Source/Code with two projects: CorePlugin and EditorPlugin. Open the solution and add a F# project. Once it’s created open the project properties and change the assembly name so that it ends with “core”
- Add a reference to Duality.dll and OpenTk.dll (you will find this on the game folder, alternatively have nuget packages too in MyGet )
- Add a new file to the project, it must inherit from Core and read like this
Lastly if you want to F5 to launch the editor you can add the following to the end of Editor.csproj.user file (replace DualityEditor.exe locations )
####Example This is an example of a component