mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 00:22:43 +08:00
7bc135e1c7
* adjust init process * fix bugs * restructure * tweak * delete useless code * fix ci * support more platform and fix some bugs * mark internal * tweak * add docs * add docs and little adjustment * fix bugs * adjust decorator execute order fix mesh error * fix bugs * revert some change * revert auto-generated code * revert auto-generated code
23 lines
515 B
Plaintext
23 lines
515 B
Plaintext
import { Application } from '<%= applicationJS %>';
|
|
|
|
const canvas = document.getElementById('GameCanvas');
|
|
const $p = canvas.parentElement;
|
|
const bcr = $p.getBoundingClientRect();
|
|
canvas.width = bcr.width;
|
|
canvas.height = bcr.height;
|
|
|
|
function topLevelImport (url) {
|
|
return System.import(url);
|
|
}
|
|
|
|
const application = new Application();
|
|
|
|
topLevelImport('cc')
|
|
.then((engine) => {
|
|
return application.init(engine);
|
|
}).then(() => {
|
|
return application.start();
|
|
}).catch((err) => {
|
|
console.error(err);
|
|
});
|