Skip to content

Instantly share code, notes, and snippets.

@renpytom
Created April 20, 2019 06:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save renpytom/aa901c9dba29297091945312a2574010 to your computer and use it in GitHub Desktop.
Save renpytom/aa901c9dba29297091945312a2574010 to your computer and use it in GitHub Desktop.

RenPyWeb - Ren'Py in your HTML5 web browser

This is the build environment for RenPyWeb.

How to build

  • Install emscripten 1.38.30 and apply patches/emscripten.patch. You can use scripts/build_toolchain.sh for this.

  • Install Ren'Py to renpy/ and pygame_sdl2 to pygame_sdl2/. It's also necessary to either build Ren'Py for the host computer, or copy a lib directory from a similar Ren'Py version to renpy/lib/. This can be done for you with scripts/checkout_renpy.sh.

  • Adapt env.sh and source it. If you used scripts/build_toolchain.sh, then source toolchain/env.sh will suffice.

  • Type: make

  • Package the game using scripts/distribute_game.sh. This will run Ren'Py to compile and distribute the game. It takes an optional argument, a path to a Ren'Py game's base directory.

How to run locally

  • Firefox: double-click on build/t/index.html

  • Firefox or Chromium:

      cd build/t/
      python3 -m http.server 8000
      chromium http://localhost:8000/
    

ASMJS version

Use asmjs.html instead of index.html.

ASMJS is deprecated in favor of WebAssembly. It can be used for older browsers, but it is most useful as a debugging tool because WASM sometimes fails to provide enough information.

How to make small-scale tests

Check the pygame-example-* targets. Symlink pygame-example/main.py to the variant you wish to experiment with.

Also check the native target to try to run Ren'Py natively with some Emscripten behavior.

How to make the devkit

make devkit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment