Files
GDevelop/GDevelop.js
Florian Rival 07d770148f Fix BBText line heights broken in the preview and exported games
* Also improve BBText performance when rendered in the scene editor.

Don't show the rest in changelog:
* This was due to the font measurement being incorrectly done by Pixi.js because the font family was having a dot in its name. It should have been quoted but for some reason is not. Instead, ensure all font family names are slugified so we don't risk such incompatibilities in the future.
* Also rework deprecated text object font handling to entirely avoid having to declare the font families at the export time.

Fix #1521
2020-06-25 21:23:24 +01:00
..

GDevelop.js

This is the port of GDevelop core classes to JavaScript. This allow GDevelop Core libraries to run in a browser or on Node.js.

🎮 GDevelop is a full featured, cross-platform, open-source game development software requiring no programming skills. Download it on the official website.

How to build

👋 Usually if you're working on GDevelop editor or extensions in JavaScript, you don't need rebuilding GDevelop.js. If you want to make changes in C++ extensions or classes, read this section.

Linux/macOS Windows
git clone https://github.com/juj/emsdk.git git clone https://github.com/juj/emsdk.git
cd emsdk cd emsdk
./emsdk update emsdk update
./emsdk install 1.39.6 emsdk install 1.39.6
./emsdk activate 1.39.6 emsdk activate 1.39.6
source ./emsdk_env.sh emsdk_env.bat
  • Launch the build from GDevelop.js folder:
    cd GDevelop.js
    npm install
    npm run build -- --dev

Output is created in /path/to/GD/Binaries/embuild/GDevelop.js/ and also copied to GDevelop 5 IDE (newIDE folder).

⏱ The linking (last step) of the build can be very long when -- --dev is not specified, so be sure to include it. Only remove it if you are about to deploy a new version.

  • You can then launch GDevelop 5 that will use your build of GDevelop.js:
    cd ..
    cd newIDE/app
    npm install
    npm start

More information in GDevelop 5 readme.

Tests

npm test

About the internal steps of compilation

The npm build task:

  • Creates Binaries/embuild directory,
  • Launches CMake inside to compile GDevelop with emconfigure to use Emscripten toolchain,
  • Updates the glue.cpp and glue.js from Bindings.idl using Emscripten WebIDL Binder,
  • Launches the compilation with make (or ninja on Windows with CMake 3.17+) (you can also compile using MinGW-32 using npm run build-with-MinGW).

See the CMakeLists.txt for the arguments passed to the Emscripten linker.

Documentation