Genome2D编译方法

Genome2D是一个高效的2D引擎,现在支持Flash(stage3d)和HTML5,因为只有作者一个人在维护,就没开源代码。

最近和作者沟通了下,已经开源啦。

作者划分了几个模块,编译起来不是特别方便,这里就简单介绍下Flash的编译方法。

因为作者把代码转换到haxe上,所以要安装haxe,现在Genome2D的版本是1.0.277,haxe版本3.1.3。

怎么安装haxe和git就不用讲了吧?一下是本地文件夹和git的对应关系:

genome2d
    core                 git@github.com:pshtif/Genome2D-Core.git
    context
        flash            git@github.com:pshtif/Genome2D-ContextFlash.git
        common           git@github.com:pshtif/Genome2D-ContextCommon.git
out

其中out是输出目录,按照上面的对应关系clone好后,在genome2d目录下,命令行运行haxe core\build\swc.hxml就生成swc,

不要以为到这里就完成了,因为haxe在链接时,不会链接lib的catalog,所以要用winrar之类的打开swc添加AGAL的catalog,不然会编译报错。

<script name="com/adobe/utils/extended/AGALMiniAssembler" mod="1407288430000">
                <def id="com.adobe.utils.extended:AGALMiniAssembler"/>
                <dep id="Array" type="e"/>
                <dep id="Boolean" type="s"/>
                <dep id="Number" type="e"/>
                <dep id="Object" type="i"/>
                <dep id="RegExp" type="s"/>
                <dep id="String" type="s"/>
                <dep id="flash.display3D:Context3D" type="s"/>
                <dep id="flash.display3D:Program3D" type="e"/>
                <dep id="flash.utils:ByteArray" type="s"/>
                <dep id="flash.utils:Dictionary" type="e"/>
                <dep id="flash.utils:Endian" type="e"/>
                <dep id="flash.utils:getTimer" type="e"/>
                <dep id="int" type="s"/>
                <dep id="trace" type="e"/>
                <dep id="uint" type="s"/>
            </script>
      <script name="fl

如果你要编译HTML5版本的,可自己研究下,比Flash版本的容易。

最后放上作者的github地址:https://github.com/pshtif,感兴趣的同学可以自己去研究下。

posted @ 2014-09-21 21:56  至尊王者  阅读(1016)  评论(0编辑  收藏  举报