这是iphoneX的截图,我们设计的宽高是1134*750,然后代码是按例子的。
Laya3D.init(750, 1134, true);
Laya.stage.scaleMode = Laya.Stage.SCALE_SHOWALL;
Laya.stage.screenMode = Laya.Stage.SCREEN_NONE;
private animate(): void {
this._position.x = Math.sin(this.scaleDelta += 0.01);
this.layaMonkey3D.transform.position = this._position;
this.camera.viewport.project(this.layaMonkey3D.transform.position, this.camera.projectionViewMatrix, this._outPos);
this.layaMonkey2D.pos(this._outPos.x / Laya.stage.clientScaleX, this._outPos.y / Laya.stage.clientScaleY);
}