obiot Posted September 2, 2020 Share Posted September 2, 2020 (edited) Hi Guys, as part of the 9.0 (master) branch, all classes have been converted to es6, and the build process now generate 3 files : melonjs.js (plain es5 umd bundle) melonjs.min.js (minified es5 umd bundle) melons-module.js (es6 module) both the es5 umd bundle and es6 module are now available under our amazon build bucket (click on the latest build version) : https://melonjs-builds.s3.amazonaws.com/index.html?prefix=artifacts/master/ I haven't yet really tested it to be honest, as I'm still focusing on other features and I haven't really yet converted any example, but It would really be nice to have any external feedback/testing on this one if anyone here wants to be a alpha-beta tester for the es6 module. the API are still supposed to be backward compatible (inheritance mechanism has not been changed yet to the es6 class inheritance), so using "import * as me from melons-bundle.js" should just be working as previously. Thanks! Edited September 3, 2020 by obiot PLAYERKILLERS 1 Quote Link to comment Share on other sites More sharing options...
obiot Posted September 3, 2020 Author Share Posted September 3, 2020 (edited) took me a few build to properly fix some remaining internal reference to the me namespace, but since build 2839, even more complex example such as the platform one is working when importing the ES6 module, so it seems that it starts to be stable enough to share and play with. here is one, for those interested, that does not have any external dependencies (using the latest dev build) import * as me from "https://melonjs-builds.s3.amazonaws.com/artifacts/master/2839/build/melonjs-module.js"; // upon device ready me.device.onReady(function () { // Initialize the video. if (!me.video.init(1218, 562, {scale : "auto"})) { alert("Your browser does not support HTML5 canvas."); return; } // add a gray background layer me.game.world.addChild(new me.ColorLayer("background", "#202020")); // add a text object in the center of the display me.game.world.addChild(new me.Text(609, 281, { font: "Arial", size: 160, fillStyle: "#FFFFFF", textBaseline : "middle", textAlign : "center", text : "Hello World !" })); }); Edited September 4, 2020 by obiot Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.