运行playn的html版本 [英] running html version of playn

查看:122
本文介绍了运行playn的html版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在eclipse(http://code.google.com/p/playn/wiki/GettingStarted#Running_via_Eclipse)上安装了playn,我加载了示例程序,并且加载了文件,Java运行良好.但是对于HTML 我右键单击Showcase-html> google>编译 我没有任何错误:

I have playn installed on eclipse (http://code.google.com/p/playn/wiki/GettingStarted#Running_via_Eclipse), i loaded the sample programs and they load file, the java one runs fine. But for html I right click the showcase-html > google > compile I don't get any errors:

Compiling module playn.showcase.Showcase
   Compiling 1 permutation
      Compiling permutation 0...
   Compile of permutations succeeded
Linking into C:\Users\(my path)\playn-samples\showcase\html\target\playn-showcase-html-1.0-SNAPSHOT\showcase
   Link succeeded
   Compilation succeeded -- 12.208s

然后 以> Web应用程序的身份运行

then run as > web application

我在开发"标签中获得了一个网址:

I get a url in the development tab:

http://127.0.0.1:8888/Showcase.html?gwt.codesvr=127.0.0.1:9997

当我运行它时,它会挂起我的浏览器

when I run this it hangs my browser

运行此命令时:

http://127.0.0.1:8888/Showcase.html

在弹出窗口上显示可能需要(建议)GWT模块",并且不加载任何内容.

it says "GWT MODULE MAY NEED TO BE (RECOMPILED)" on a popup and loads nothing.

你知道什么地方可能出问题吗?

Any idea what might be wrong?

推荐答案

我不建议使用Eclipse来编译和测试PlayN游戏的HTML5后端. 使用Java后端进行开发和测试,当需要构建HTML5版本时,请使用Maven命令行进行构建和测试.它更加可靠.

I don't recommend using Eclipse to compile and test the HTML5 backend of a PlayN game. Develop and test using the Java backend, and when the time comes to build the HTML5 version, use the Maven command line to build and test it. It is far more reliable.

但是,如果您坚持要在Eclipse中测试HTML5后端,则必须小心.上面所做的是先将Java代码编译为JavaScript(使用 Google->编译),然后使用GWT devmode存根覆盖已编译的JavaScript(当您使用 Run as- > Web应用程序).

However, if you insist on testing the HTML5 backend in Eclipse, you have to be careful. What you've done above is to first compile the Java code to JavaScript (by using Google -> Compile) and then overwritten the compiled JavaScript with GWT devmode stubs (when you used Run as -> Web application).

相反,您应该使用 Google->编译,然后展开 playn-showcase-html->目标-> playn-showcase-html-1.0-SNAPSHOT 右键单击 Showcase.html ,然后选择打开方式-> Web浏览器.您需要在网络服务器中运行生成的代码,以避免跨站点脚本问题.

Instead, you should use Google -> Compile, and then expand playn-showcase-html -> target -> playn-showcase-html-1.0-SNAPSHOT and right click on Showcase.html and select Open With -> Web Browser. You'll need to run the generated code in a webserver to avoid crosssite scripting issues.

您永远都不想使用GWT devmode(以-> Web应用程序运行)来测试游戏的HTML5后端,因为从病理上来说,GWT devmode在运行诸如HTML5游戏之类的高性能代码方面速度较慢

You never want to use GWT devmode (Run as -> Web application) to test the HTML5 backend of your game, because GWT devmode is pathologically slow for running high-performance code like an HTML5 game.

这篇关于运行playn的html版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆