Files
cocos-engine/platforms/runtime/common/engine/game.js
2021-12-27 14:35:18 +08:00

17 lines
648 B
JavaScript

cc.game.restart = function () {
};
cc.game._setAnimFrame = function () {
const frameRate = this._frameRate;
this._frameTime = 1000 / frameRate;
ral.setPreferredFramesPerSecond(frameRate);
window.rAF = window.requestAnimationFrame;
window.cAF = window.cancelAnimationFrame;
};
ral.onWindowResize && ral.onWindowResize(function (width, height) {
// Since the initialization of the creator engine may not take place until after the onWindowResize call,
// you need to determine whether the canvas already exists before you can call the setCanvasSize method
cc.game.canvas && cc.view.setCanvasSize(width, height);
});