playn

Why net().get on success return empty string

拈花ヽ惹草 提交于 2019-12-23 04:54:21
问题 This is with playn. I use this, only to try how it works: net().get("http://google.com", new Callback<String>() { @Override public void onSuccess(String result) { drawResult(result); } @Override public void onFailure(Throwable cause) { // TODO Auto-generated method stub drawResult(cause.toString()); } }); } When i started this for Android or Java, onSuccess result is ok. When I started for html result is empty, where i wrong? Thanks and sorry for my bad English. 回答1: That has to to with the

How to resolve the playN asset path error?

余生长醉 提交于 2019-12-23 04:18:10
问题 I am getting the following error when I run my playN project. "No file found for: /myproject/myproject.nocache.js" Also I am getting only a black screen in the browser. In the MyProjectHtml.java file I am giving the path as "platform.assets().setPathPrefix("myproject/");" How can I resolve this problem. I am not finding any file with the name "nocache". Note: The comment in one of my previous question's answer will be useful: How to Run my playN game in production mode locally? Thank you.

How do I convert a POJO to JSON in PlayN?

百般思念 提交于 2019-12-20 03:10:54
问题 I want to send a string with json content to a REST service. How can I convert a simple POJO to a json string? Normaly I would use Gson to do this: My class that I want to convert: public class UserMdl { String name; String pwHash; //Constructur, getter and setter.... } And my code to do this: UserMdl userMd = new UserMdl("name", "pwHash"); Gson gson = new Gson(); String json = gson.toJson(userMdl); However I cannot get gson to work with PlayN in the HTML build. It only works in the Java

Unable to create skeleton PlayN project in Eclipse

蓝咒 提交于 2019-12-19 07:39:29
问题 I'm getting to the point where I've almost given up trying to use PlayN. I've tried PlayN's Getting Started guide here, as well as GamesFromScratch's updated guide here, with no luck. Every time I try and create a New->Other->"Maven Project" with the code.googlecode.playn 1.3.1 archetype, I get this error message: 'Creating playn-archetype' has encountered a problem Unable to create project from archetype [com.googlecode.playn:playn-archetype:1.3.1] The defined artifact is not an archetype I

Build error: missing artifact com.sun:tools:jar:1.6

◇◆丶佛笑我妖孽 提交于 2019-12-18 19:16:07
问题 Trying to build PlayN sample projects I get: Missing artifact com.sun:tools:jar:1.6 pom.xml /playn-cute line 6 Maven Dependency Problem On every pom.xml file. How do I resolve it? Edit : I've added the profiles node to the pom.xml , but the error remains. I've checked the tools.jar is actually exists, and it didn't. So I've added tools.jar to lib folder. And still the error remains. The full pom.xml: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0"

Missing artifact com.sun:tools:jar

戏子无情 提交于 2019-12-17 04:27:22
问题 I've been following the getting started tutorial, but am stuck after I imported the playn project using Maven. I am using Eclipse Indigo running on 64bit Windows 7. All the imported projects have the same error: Missing Artifact com.sun:tools:jar in all the pom.xml files. After a couple hours of searching forums I have tried: Installing the latest Java 1.6.029 Changing my JAVA_HOME environment variable to point to \program files\Java\jdk1.6_029 Changing my Eclipse Java preferences to use the

PlayN - Draw on an Image

蓝咒 提交于 2019-12-14 02:38:27
问题 I have recently started using PlayN for a hobby project and has now stumbled upon a problem. I would like to draw some lines and text onto an Image and save this image for later use. In Java I would just make a BufferedImage and use its graphicsBuffered to draw upon, but I can not find any similar solution in PlayN. Is this at all possible, and if so how ? I somehow need to be able to convert a BufferedImage to an Image and the other way around. 回答1: Create a CanvasImage, draw your image onto

In PlayN, how do you exclude a directory from being compiled by Maven?

孤街浪徒 提交于 2019-12-13 03:36:54
问题 I want to build the html version of my game from the command line using maven. However, when I run the package command for the core folder: mvn clean package -pl core,html I get the following errors because of some unit tests in my source path: [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /home/klenwell/projects/mygame/playn/mygame/core/src/main/java/mygame/playn

Pixel level graphics in PlayN

爱⌒轻易说出口 提交于 2019-12-13 03:36:14
问题 I want to do pixel level graphics on a PlayN game whose main target is HTML5. However, PlayN's Canvas object does not provide access to the CanvasPixelArray class, or the putImageData and getImageData functions. I'm worried that using drawPoint for each pixel will be pretty slow; is there a better way of doing it? 回答1: There's no pixel manipulation API for PlayN at the moment. If you only want to target HTML5, you can use the GWT methods to create and manipulate ImageData objects and then

PlayN mp3 support UnsupportedAudioFileException

a 夏天 提交于 2019-12-13 00:48:08
问题 I've been researching for days to figure out how to resolve this with no luck. The PlayN JavaSound class uses the javax.sound.sampled.AudioSystem class to play sounds, and the mp3 format does not seem to be supported. javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input stream at javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1102) at playn.java.JavaSound.init(JavaSound.java:71) ...... I cannot find a lot of information on