After following the castledb haxelib package installation instructions...
Steps:
-
From HaxeDevelop, Project->New Project, select 'HaxeFlixel Project'
-
Open CastleDB, create/edit sheets, save into 'assets/data/XXX.cdb' where XXX is your db name
-
Create 'Data.hx' file per the castledb instructions with the following line:
private typedef Init = haxe.macro.MacroType < [cdb.Module.build("assets/data/XXX.cdb")] > ;
- Open 'Project.XML' and add these two entries under the Libraries section:
<haxelib name="castle"/>
<haxeflag name="-resource" value="assets/data/XXX.cdb" />
- Import Data.hx and instantiate your dbase in Main.hx:
...
import xxx.xxx.xx.Data;
class Main extends Sprite {
public function new() {
...
#if js
Data.load(haxe.Resource.getString(AssetPaths.XXX__cdb));
#else
Data.load(null));
#end
trace(Data.XXX);
...
}
}
Thank you so much! Saved me from hours of headache. I tried following the example they have at https://github.com/ncannasse/castle/blob/master/src/test/Test.hx, but I just couldn't get it to work.