GDevelopで他のjsライブラリをincludeは可能?


#1

Is possible to include other js libraries in GDevelop?

例えば、Vector2Dライブラリとか。
e.g. Vector2


#2

publishしたindex.htmlを編集することもできますが、次のpublishで消えてしまいますしね…
I can edit and include the index.html to be published, but it will be overridden in the next publish…


#3

Not easily. There is a feature request on the roadmap: https://trello.com/c/rnmnF4nt/127-add-support-for-adding-arbitrary-external-source-files-javascript-that-are-bundled-with-the-game

You can always copy paste the whole file in a JS event that you execute only at the beginning of the game though :slight_smile:


#4

beginning of the game? beginning of the scene? is’t the same?
I know is “runtimeScene.getTimerManager().isFirstFrame()”.

I also do this.
In External Events…

if (runtimeScene.getTimeManager(). isFirstFrame()) {
runtimeScene.mylib = {};
var mylib = runtimeScene.mylib;
mylib.getMyVector2 = function() {…}
}

…then link this External Events at the beginning of each scene.

LoL.