I am working on a project, in which I notice that 99% coding is going to be reused. Only the assets that are being used and preloaded, will be going to be changed. But I am wondering, how can I manage including the assets conditionally in the project.xml ?
I see it being done when using platforms like html, flash etc, by using tag attributes like if=‘html5’ . But is their any way I can use custom string, like " if=‘game1’ " etc ?
Because if I don’t include the conditionally, and instead preload all of the assets for each project, that’s definitely going to increase the time at preloading. Right ?
maybe you can set multiples “project.xml” or “project.hxp” files, one file for each different build, setting different asset paths.
You can compile adding the file/path argument on build command:
- openfl build /path/to/project/project_01.xml windows
- openfl build /path/to/project/project_02.xml windows
- openfl build /path/to/project/project_03.xml windows
You can also do something such as:
<assets path="assets/game2" if="game2" />
openfl test flash -Dgame2
Another option is to use an include, such as:
and then the “Game1/project.xml” and “Game2/project.xml” could both use
<include path="../Common/include.xml" />