mirror of
https://github.com/cocos/cocos-engine.git
synced 2026-09-07 00:02:53 +08:00
17 lines
648 B
JavaScript
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);
|
|
});
|