调整窗口大小时保持子项的大小(阶段)

时间:2019-04-02 11:39:40

标签: pixi.js

  

Blockquote

我需要帮助,屏幕旋转时需要它,所有孩子都保持其大小,但是背景已调整为屏幕大小。

`` `let app = new PIXI.Application({ 
  width: window.innerWidth, 
  height: window.innerHeight,
  autoResize: true,
  resolution: devicePixelRatio 
});
document.body.appendChild(app.view);`  ``

`` `function resize() {
  app.view.style.width = window.innerWidth + 'px';
  app.view.style.height = window.innerHeight + 'px';
}

window.onresize =调整大小;`

现在,我的渲染适应了屏幕的大小,但是所有子元素都被拉伸了enter image description here

enter image description here

0 个答案:

没有答案
相关问题