COMMUNITY

Create custom project template in HaxeDevelop

ide
haxedevelop
(Mighty Marcus) #1

On the HaxeDevelop website it is written under “Project Management” that …

You can create, customize and share your own project templates.

But how? I have some boilerplate code for 2D game production and it would be nice to just create a new project like “OpenFL 2D Game” with my init functions already built in.

Would be nice to speed up prototyping games, but I did not find anything how to do it on the haxedevelop.org website.

(Marcelo Serpa) #2

When you say “template” you refer to parameterized templates, where you input some data at the moment you create it and the template gets customized with them? Because if that’s not needed, you can just git the boilerplate somewhere, clone a new copy whenever you need it and customize manually.

Another (perhaps overkill) option is to use something like Yeoman, which was made specifically for generating templates/boilerplates, it has a lot of niceties to help input the basic data in a more user-friendly way, among other things, but I never felt the need to use it, to be honest.

Can’t help you with HaxeDevelop though since I don’t use it, sorry.

(Ian Harrigan) #3

Its a long time since i used them, but i remember writing similar for HaxeUI (version 1): https://github.com/ianharrigan/haxeui/tree/master/templates/flash-develop - iirc, you just zip folders and file templates into a .zip with an .fdz extensions and drop it into a HD folder (which i cant remember now) and they should just appear…

(Mighty Marcus) #4

thank you, guys.

(Philippe) #5

You can check the HaxePunk project template:

The FDZ file then needs to be opened by FD/HD to be installed in the right location in your user local data.

(Marcelo Serpa) #6

What’s the advantage of these kind of templates over just created something on say, github and cloning it everytime you start a new project off it?

(Ian Harrigan) #7

Im not really sure there is a huge difference to be honest… I suppose the main thing is that the template is parameterised, (see: https://github.com/ianharrigan/haxeui/blob/master/templates/flash-develop/%24(BaseDir)/Projects/600%20HaxeUI%20-%20HaxeUI%20Project/src/%24(PackagePath)/Main.hx.template#L1), ie, the “${PackagePath}” but there isnt really that many options that you could provide there:

I dont really use these types of templates anymore to be honest (i use a command line) - it could well be that there are other params for the templates i just dont know about - i guess also, for first time users its nice to have a something in a UI to use…

Edit: if FD/HD had the option to then start up a wizard of somekind after this dialog then i think they would start to get more useful again (for me at least)

(Philippe) #8

I agree ultimately templates in the GUI are a bit old fashioned nowadays :slight_smile:

But hey kids, it comes from a time when GitHub or Npm did not even exist!

That said, where are the CLI Haxe projects generators?

(Jens Fischer) #9

@elsassph Mark made one once: https://github.com/markknol/hxnew

(Philippe) #10

Oh you’re right, I had forgotten it. I mean I did expect that there was something :smiley:

(Ian Harrigan) #11

this is HaxeUI’s one: https://github.com/haxeui/haxeui-core/tree/master/cli