2.0.0-beta1 • Published 2 months ago

gdcore-tools v2.0.0-beta1

Weekly downloads
25
License
MIT
Repository
github
Last release
2 months ago

gdcore-tools

A package that downloads and bootstraps any version of GDevelops Core library.

Installation

npm install gdcore-tools

Usage

Require the module, call it and add a callback with .then. This will download the latest version of GDevelop, extract the required files, and load GDCore wrapped with helpful functions.

const loadGD = require("gdcore-tools");
loadGD().then((gdtools) => {
  // Create something awesome!
});

Examples

You can find examples here.

API

You can find the API for GDCore (WrappedGD.gd) at the official GDevelop website. Note that every method in PascalCase on the docs have to be used in camelCase in JavaScript.

Events:

print:

Triggered when GDCore wants to print a message.

error:

Triggered when GDCore errors.

loadGD(version?: string): Promise<WrappedGD>

The entrypoint of the module. Accept a github release tag to specify a specific version to download and use.

WrappedGD.gd: gd

The actual gd namespace of GDCore.

WrappedGD.loadProject(projectLocation: string): Promise<gd.Project>

Accepts a full path to a .json file, and returns a promise that resolves to the loaded gd.Project instance.

WrappedGD.saveProject(project: gd.Project, fileName?: string, filePath?: string): Promise<void>

Saves a gd.Project to a JSON file. The default path is ./ and the default filename game.json. Returns a promise that resolves once the file is saved.

WrappedGD.exportProject(project: gd.Project, outputDir: string, options?: Object): void

Exports a project to a directory. Some options may be passed to the exporter, but they aren't officially documented. Returns a promise that resolves once the export is done.

WrappedGD.reloadEventsFunctions(project): void

Regenerates the code and reloads all events based extensions.

WrappedGD.getRuntimePath(): string

Get the path to the downloaded and built GDJS runtime.

2.0.0-beta3

2 months ago

2.0.0-beta2

2 months ago

2.0.0-beta1

2 months ago

1.0.9

9 months ago

1.0.8

9 months ago

1.0.7

9 months ago

1.0.6

9 months ago

1.0.5

2 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago