本文介绍了Flambe HTML编译问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始使用Haxe/Flambe,但是似乎无法编译为HTML.据我所知,这是一个内部问题.它可以编译为Flash.这是我的控制台输出

C:\Users\UserName\Dropbox\Projects\Project\Game>flambe build --debug html
Building: build/web
haxe -main game.Main -lib flambe -cp src -dce full -debug --no-opt --no-inline -D html -D js-es5 -D js-flatten --macro flambe.platform.ManifestBuilder.use("build/web/assets") -D source-map-content -js
 build/web/targets/main-html.js
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlPlatform.hx:76: characters 8-41 : js.html.DOMElement should be js.html.Element
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/CanvasTextureRoot.hx:44: characters 28-32 : Array<Int> should be haxe.io.BytesData
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/CanvasTextureRoot.hx:44: characters 28-32 : Array<Int> should be js.html.ArrayBuffer
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/CanvasTextureRoot.hx:44: characters 28-32 : For function argument 'b'
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/CanvasTextureRoot.hx:39: lines 39-45 : Missing return haxe.io.Bytes
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlAssetPackLoader.hx:364: characters 16-38 : String should be js.html.XMLHttpRequestResponseType
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlAssetPackLoader.hx:367: characters 12-37 : String should be js.html.XMLHttpRequestResponseType
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlAssetPackLoader.hx:368: characters 16-42 : String should be js.html.XMLHttpRequestResponseType
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlAssetPackLoader.hx:205: characters 12-43 : String should be js.html.XMLHttpRequestResponseType
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlExternal.hx:37: characters 42-48 : js.html.Window should be haxe.Function
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlExternal.hx:37: characters 42-48 : For function argument 'func'
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlExternal.hx:25: lines 25-38 : Missing return Dynamic

我正在使用Haxe 3.2.0和Flambe 4.1.0.我一直在互联网上寻找解决方案,但似乎找不到.任何帮助将非常感激.谢谢.

解决方案

如果要将Flambe与Haxe 3.2一起使用,则应应用以下修补程序:

https://github.com/aduros/flambe/commit/ec084011873cf16635f4e2a77cc0d2dc6c58625d

I have just started with Haxe/Flambe, but I seem to have a problem compiling to HTML. From what I can tell it's an internal problem. It compiles to Flash just fine. Here's my console output

C:\Users\UserName\Dropbox\Projects\Project\Game>flambe build --debug html
Building: build/web
haxe -main game.Main -lib flambe -cp src -dce full -debug --no-opt --no-inline -D html -D js-es5 -D js-flatten --macro flambe.platform.ManifestBuilder.use("build/web/assets") -D source-map-content -js
 build/web/targets/main-html.js
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlPlatform.hx:76: characters 8-41 : js.html.DOMElement should be js.html.Element
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/CanvasTextureRoot.hx:44: characters 28-32 : Array<Int> should be haxe.io.BytesData
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/CanvasTextureRoot.hx:44: characters 28-32 : Array<Int> should be js.html.ArrayBuffer
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/CanvasTextureRoot.hx:44: characters 28-32 : For function argument 'b'
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/CanvasTextureRoot.hx:39: lines 39-45 : Missing return haxe.io.Bytes
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlAssetPackLoader.hx:364: characters 16-38 : String should be js.html.XMLHttpRequestResponseType
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlAssetPackLoader.hx:367: characters 12-37 : String should be js.html.XMLHttpRequestResponseType
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlAssetPackLoader.hx:368: characters 16-42 : String should be js.html.XMLHttpRequestResponseType
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlAssetPackLoader.hx:205: characters 12-43 : String should be js.html.XMLHttpRequestResponseType
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlExternal.hx:37: characters 42-48 : js.html.Window should be haxe.Function
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlExternal.hx:37: characters 42-48 : For function argument 'func'
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlExternal.hx:25: lines 25-38 : Missing return Dynamic

I am using Haxe 3.2.0 and Flambe 4.1.0.I have been crawling the internet looking for a solution, but couldn't seem to find one. Any help would be much appreciated.Thanks.

If you want to use Flambe with Haxe 3.2, you should apply this patch:

https://github.com/aduros/flambe/commit/ec084011873cf16635f4e2a77cc0d2dc6c58625d

这篇关于Flambe HTML编译问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-14 13:08