minigame-tuanjie-transform-sdk/Runtime/playable-default/plugins/screen-adapter.js

10 lines
325 B
JavaScript
Raw Normal View History

2025-06-19 15:41:14 +08:00
wx.onWindowResize((res) => {
window.innerWidth = res.windowWidth;
window.innerHeight = res.windowHeight;
});
wx.onDeviceOrientationChange(() => {
const info = wx.getWindowInfo ? wx.getWindowInfo() : wx.getSystemInfoSync();
window.innerWidth = info.screenWidth;
window.innerHeight = info.screenHeight;
});