[add] 螢幕旋轉
This commit is contained in:
@@ -13,7 +13,22 @@ export default class Manager extends cc.Component {
|
||||
|
||||
protected onLoad(): void {
|
||||
this.webview.url = `https://karolchang.github.io/jm-expense-vue-ts/?ignore=${Date.now()}`;
|
||||
this.webview.node.active = true
|
||||
this.webview.node.active = true;
|
||||
|
||||
cc.view.setResizeCallback(this._resize.bind(this));
|
||||
this._resize();
|
||||
}
|
||||
|
||||
private _resize(): void {
|
||||
let Canvas: cc.Canvas = cc.Canvas.instance;
|
||||
Canvas.designResolution = cc.size(Canvas.designResolution.height, Canvas.designResolution.width);
|
||||
// let rect: DOMRect = cc.game.canvas.getBoundingClientRect();
|
||||
// /** 判断是否是横屏 */
|
||||
// let landscape: boolean = false;
|
||||
// if (rect.width > rect.height) {
|
||||
// landscape = true;
|
||||
// }
|
||||
// // 根据横竖屏调整节点的位置适配等
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
Reference in New Issue
Block a user