openfl create project ProjectName
will create an empty project, like DisplayingABitmap
but without the code or asset file. The project.xml file is mandatory, but you can safely delete the ProjectName.hxproj file (that’s exclusively for FlashDevelop/HaxeDevelop).
You will probably want to move Main.hx
into folders corresponding to a package. Then set that package in project.xml
(you’ll need to update both <meta package />
and <app main />
.
Because project.xml
mentions the Assets/
folder, you’ll need to create that, whether or not there’s anything inside. Either that or comment the line in project.xml
. You don’t have to create Export/
.
To get it working in VS Code, head to the extensions (by default, the fifth icon down on the side of the window), search for “Lime,” and choose to install. This should automatically install the Haxe extension, but if not, search for that and install it too. Then open your project folder in VS Code (if you hadn’t already).
If all goes well, you should see “Lime HTML5 Release” in the bottom left. You can click “HTML5” to change your build target, or “Release” to switch to debug mode. You’ll have to compile once (ctrl+shift+B) before it provides code completion.
Finally, you’ll probably want to add a keyboard shortcut for “Run Test Task,” because that’s the one that compiles and runs your app.