running html version of playn

蓝咒 提交于 2019-12-05 08:08:06

问题


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

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

when I run this:

http://127.0.0.1:8888/Showcase.html

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

Any idea what might be wrong?


回答1:


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.

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).

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. EDIT: You'll need to run the generated code in a webserver to avoid crosssite scripting issues.

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.



来源:https://stackoverflow.com/questions/8814547/running-html-version-of-playn

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!