修复stage的宽高错误
This commit is contained in:
@@ -1132,7 +1132,7 @@ var Scene = (function (_super) {
|
||||
Physics.reset();
|
||||
if (this.entityProcessors)
|
||||
this.entityProcessors.begin();
|
||||
this.camera.onSceneSizeChanged(this.stage.width, this.stage.height);
|
||||
this.camera.onSceneSizeChanged(this.stage.stageWidth, this.stage.stageHeight);
|
||||
};
|
||||
Scene.prototype.onActive = function () {
|
||||
};
|
||||
|
||||
2
demo/libs/framework/framework.min.js
vendored
2
demo/libs/framework/framework.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -105,8 +105,14 @@ class Main extends eui.UILayer {
|
||||
player.addComponent(new SpawnComponent(EnemyType.worm));
|
||||
player.addComponent(new PlayerController());
|
||||
|
||||
let player2 = scene.createEntity("player2");
|
||||
player2.addComponent(new BoxCollider()).setSize(99, 99);
|
||||
for (let i = 0; i < 20; i ++){
|
||||
let image = new eui.Image(RES.getRes("checkbox_select_disabled_png"));
|
||||
let player2 = scene.createEntity("player2");
|
||||
player2.addComponent(new SpriteRenderer()).setSprite(image);
|
||||
this.addChild(image);
|
||||
player2.transform.position = new Vector2(Math.random() * 100 * i, Math.random() * 100 * i);
|
||||
}
|
||||
|
||||
|
||||
scene.camera.setPosition(new Vector2(-200, -200));
|
||||
|
||||
|
||||
@@ -1132,7 +1132,7 @@ var Scene = (function (_super) {
|
||||
Physics.reset();
|
||||
if (this.entityProcessors)
|
||||
this.entityProcessors.begin();
|
||||
this.camera.onSceneSizeChanged(this.stage.width, this.stage.height);
|
||||
this.camera.onSceneSizeChanged(this.stage.stageWidth, this.stage.stageHeight);
|
||||
};
|
||||
Scene.prototype.onActive = function () {
|
||||
};
|
||||
|
||||
2
source/bin/framework.min.js
vendored
2
source/bin/framework.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -110,7 +110,7 @@ class Scene extends egret.DisplayObjectContainer {
|
||||
if (this.entityProcessors)
|
||||
this.entityProcessors.begin();
|
||||
|
||||
this.camera.onSceneSizeChanged(this.stage.width, this.stage.height);
|
||||
this.camera.onSceneSizeChanged(this.stage.stageWidth, this.stage.stageHeight);
|
||||
}
|
||||
|
||||
/** 场景激活 */
|
||||
|
||||
Reference in New Issue
Block a user