简体   繁体   中英

How to make a Processing Sketch with external libraries and files work on a website?

So I have made a game using Processing and have used 2 java libraries (minim for sound and java.util.map for a hashmap), as well as having many external image and sound files which the game uses. I want to put the game on my website, in a way that you can play it without downloading it. I have not been able to find a way of ding this so I thought I'd ask here.

Short answer: you can't.

You can deploy basic Processing sketches using Processing.js , but that won't work if your sketch contains Java libraries.

(Side note: you don't need to import java.util.HashMap to use it in a Processing sketch. Just use HashMap directly. That would actually work with Processing.js.)

If you use Java libraries, then your only option is to deploy as an application and have users download your program.

The other option is to get rid of the Java libraries and use JavaScript libraries instead. You can call JavaScript code from Processing.js code. See here for more info.

Shameless self-promotion: I wrote a guide on the different versions of Processing and how you can deploy them, available here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM