|
@@ -22,6 +22,8 @@ let filter_home_assets = [
|
|
];
|
|
];
|
|
|
|
|
|
class HNScenceManager {
|
|
class HNScenceManager {
|
|
|
|
+ PORTRAIT = 0
|
|
|
|
+ LANDSCAPE = 1
|
|
constructor() {
|
|
constructor() {
|
|
this._rootComponent = null;
|
|
this._rootComponent = null;
|
|
this._currGameNode = null;
|
|
this._currGameNode = null;
|
|
@@ -225,8 +227,16 @@ class HNScenceManager {
|
|
pgContentP = this.pgContentP = new cc.Node("pgContentP")
|
|
pgContentP = this.pgContentP = new cc.Node("pgContentP")
|
|
runScene.addChild(pgContentP);
|
|
runScene.addChild(pgContentP);
|
|
}
|
|
}
|
|
- pgContentP.angle = 90
|
|
|
|
- pgContentP.setContentSize(runScene.getContentSize().height,runScene.getContentSize().width)//因为旋转了,宽高对调了
|
|
|
|
|
|
+
|
|
|
|
+ let direct = 1//PG游戏横着放
|
|
|
|
+ if (direct == this.PORTRAIT) {
|
|
|
|
+ pgContentP.angle = 90
|
|
|
|
+ pgContentP.setContentSize(runScene.getContentSize().height,runScene.getContentSize().width)//因为旋转了,宽高对调了
|
|
|
|
+ } else {
|
|
|
|
+ pgContentP.setContentSize(750,1334);
|
|
|
|
+ let scale = runScene.getContentSize().height/1334;
|
|
|
|
+ pgContentP.setScale(scale);
|
|
|
|
+ }
|
|
gameNode.parent = pgContentP
|
|
gameNode.parent = pgContentP
|
|
pgContentP.setAnchorPoint(0.5, 0.5);
|
|
pgContentP.setAnchorPoint(0.5, 0.5);
|
|
pgContentP.setPosition(cc.v2(0,0))
|
|
pgContentP.setPosition(cc.v2(0,0))
|