Haxe - 像ActionScript一样嵌入文件?

RCI*_*CIX 3 haxe actionscript-3 embedded-resource

在ActionScript中,您可以执行以下操作:

[Embed(source = "src/myfile.xml", mimeType = "application/octet-stream")]
private var xml : Class;
Run Code Online (Sandbox Code Playgroud)

它将嵌入您的文件以用于代码.我怎样才能在Haxe做类似的事情?

str*_*ium 11

自问题提出以来,情况发生了变化.使用haxe的现代版本可以做到:

@:bitmap("test.png") class TestBMD extends BitmapData {}
var bm = new Bitmap(new TestBMD(100,100));
Run Code Online (Sandbox Code Playgroud)