Commit fca8e3db authored by rockyl's avatar rockyl

修复

parent a5caae85
......@@ -349,6 +349,7 @@ export class Stage extends Container {
* @param {number} renderType 渲染类型2canvas
* @param {boolean} transparent 透明否,默认透明true,此时bgColor无效
* @param {number} bgColor 背景颜色十六进制
* @param autoResize 是否自动重置尺寸
* @public
* @since 1.0.0
*/
......@@ -360,7 +361,8 @@ export class Stage extends Container {
scaleMode: string = StageScaleMode.FIXED_WIDTH,
renderType: RENDERER_TYPE = RENDERER_TYPE.WEBGL,
transparent: boolean = true,
bgColor: number = 0x000000
bgColor: number = 0x000000,
autoResize: boolean = false,
) {
super();
let s: Stage = this;
......@@ -376,6 +378,7 @@ export class Stage extends Container {
s.rootDiv = div;
s.setFrameRate(frameRate);
s._scaleMode = scaleMode;
s.autoResize = autoResize;
//s.anchorX = desW >> 1;
//s.anchorY = desH >> 1;
......
......@@ -52,7 +52,7 @@ export async function launchWithConfig(config, loadingDelegate?, onStart?) {
setTimeout(resolve, 300);
});
return await new Promise(resolve => {
const {containerId, designWidth, designHeight, frameRate, scaleMode, rendererType,} = config.options;
const {containerId, designWidth, designHeight, frameRate, scaleMode, rendererType, bgColor, autoResize,} = config.options;
let stage = window['stage'] = new Stage(
containerId || "game-container",
designWidth || 750,
......@@ -60,6 +60,9 @@ export async function launchWithConfig(config, loadingDelegate?, onStart?) {
frameRate || 60,
scaleMode || StageScaleMode.FIXED_WIDTH,
rendererType || RENDERER_TYPE.WEBGL,
true,
bgColor,
autoResize,
);
initAutoLayout(stage);
Stage.flushAll();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment