resolution设置为设备的分辨率,fgui控件都点击不到了,文本也显示残缺


this._guiApp = new PIXI.Application({
view: document.querySelector("#canvasContainer2 canvas") as HTMLCanvasElement,
backgroundColor: 0x000000,
autoStart: true,
useContextAlpha: true,
backgroundAlpha: 0,
// width: window.innerWidth,
// height: window.innerHeight,
antialias: false,//设置抗锯齿
powerPreference: "high-performance",//对于具有双显卡的设备,设置为“高性能”
resolution: window.devicePixelRatio, //渲染器的分辨率/设备像素比。 window.devicePixelRatio
//autoDensity: true
}
);
//this._guiApp.renderer.resize(window.innerWidth, window.innerHeight);
//PIXI.settings.SCALE_MODE = PIXI.SCALE_MODES.NEAREST;
this._pixi = this._guiApp;
this._drawPanel = drawPanel;
fgui.GRoot.inst.attachTo(this._pixi, {
//resolution: window.devicePixelRatio, // contentScaleFactor
designWidth: 768,
designHeight: 1024,
scaleMode: fgui.StageScaleMode.FIXED_WIDTH,
orientation: fgui.StageOrientation.PORTRAIT,
alignV: fgui.StageAlign.TOP,
alignH: fgui.StageAlign.LEFT,
});
下图左边的文字应该是填充两个字,现在只显示一部分了。
未标题-1.png
已邀请:

谷主

赞同来自:

PIXI啊,要自己排查解决了。

要回复问题请先登录注册