Commit 279d0fcc authored by Li MingZhe's avatar Li MingZhe

feat: 边缘美化

parent ecbbe282
...@@ -81,7 +81,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -81,7 +81,7 @@ export class PlayComponent implements OnInit, OnDestroy {
canTouch = true; canTouch = true;
KEY = 'pu_16'; KEY = 'pu_161';
// ----- // -----
picArr; picArr;
...@@ -163,7 +163,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -163,7 +163,7 @@ export class PlayComponent implements OnInit, OnDestroy {
initDefaultData() { initDefaultData() {
const data = { "bgItem": { "url": "http://staging-teach.cdn.ireadabc.com/92494971d4791dc82ea2e6a2608a2499.jpeg", "rect": { "x": 279.14, "y": 0, "width": 964.72, "height": 572 } }, "hotZoneItemArr": [{ "id": "1618278861641", "index": 0, "itemType": "rect", "fontScale": 1.18984375, "imgScale": 1, "mapScale": 1.18984375, "gIdx": "0", "rect": { "x": 171.86, "y": 421, "width": 341, "height": 122 } }, { "id": "1618278871717", "index": 1, "itemType": "rect", "fontScale": 1.18984375, "imgScale": 1, "mapScale": 1.18984375, "gIdx": "0", "rect": { "x": 559.86, "y": 225, "width": 293, "height": 156 } }], "title": "qipao qipao qipao qipao qipao qipao ." }; const data = {"bgItem":{"url":"http://staging-teach.cdn.ireadabc.com/92494971d4791dc82ea2e6a2608a2499.jpeg","rect":{"x":183.49,"y":0,"width":651.01,"height":386}},"hotZoneItemArr":[{"id":"1618278861641","index":0,"pic_url":"http://staging-teach.cdn.ireadabc.com/893624fd823266fb2b7dbd6460d5ff40.png","itemType":"pic","fontScale":0.7953125,"imgScale":3.520256951541036,"mapScale":0.7953125,"gIdx":"0","rect":{"x":81.44,"y":269.84,"width":299.22,"height":105.59}},{"id":"1618278871717","index":1,"pic_url":"http://staging-teach.cdn.ireadabc.com/893624fd823266fb2b7dbd6460d5ff40.png","itemType":"pic","fontScale":0.7953125,"imgScale":2.586359079025084,"mapScale":0.7953125,"gIdx":"0","rect":{"x":365.62,"y":159.79,"width":219.84,"height":96.08}},{"id":"1618304085412","index":2,"pic_url":"http://staging-teach.cdn.ireadabc.com/d692cd55f13c228fa18d0c9ff2c85a03.png","itemType":"pic","fontScale":0.7953125,"imgScale":2.1765494370920364,"mapScale":0.7953125,"gIdx":"0","rect":{"x":87.6,"y":55.14,"width":171.95,"height":165.42}},{"id":"1618306822017","index":3,"itemType":"point","fontScale":0.7953125,"imgScale":1,"mapScale":0.7953125,"gIdx":"1","rect":{"x":531.04,"y":325.02,"width":1.77,"height":1.77}}],"title":"qipao qipao qipao qipao A qipao qip qipao A qipao qip qipao A qipao qip qipao A qipao qip"};
this.data = { contentObj: data }; this.data = { contentObj: data };
return; return;
...@@ -581,16 +581,17 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -581,16 +581,17 @@ export class PlayComponent implements OnInit, OnDestroy {
initTitle() { initTitle() {
const offY = 60;
const dialogSmall = new MySprite(); const dialogSmall = new MySprite();
dialogSmall.init(this.images.get("dialog_small")) dialogSmall.init(this.images.get("dialog_small"))
dialogSmall.x = this.canvasWidth / 2; dialogSmall.x = this.canvasWidth / 2;
dialogSmall.y = ( dialogSmall.height / 2 + 20 ) * dialogSmall.scaleY; dialogSmall.y = ( dialogSmall.height / 2 + offY ) * dialogSmall.scaleY;
this.renderArr.push(dialogSmall); this.renderArr.push(dialogSmall);
const dialogBig = new MySprite(); const dialogBig = new MySprite();
dialogBig.init(this.images.get("dialog_big")) dialogBig.init(this.images.get("dialog_big"))
dialogBig.x = this.canvasWidth / 2; dialogBig.x = this.canvasWidth / 2;
dialogBig.y = ( dialogBig.height / 2 + 20 ) * dialogBig.scaleY; dialogBig.y = ( dialogBig.height / 2 + offY ) * dialogBig.scaleY;
this.renderArr.push(dialogBig); this.renderArr.push(dialogBig);
...@@ -831,6 +832,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -831,6 +832,7 @@ export class PlayComponent implements OnInit, OnDestroy {
topArr = [];
initBg() { initBg() {
this.bgArr = []; this.bgArr = [];
...@@ -861,6 +863,27 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -861,6 +863,27 @@ export class PlayComponent implements OnInit, OnDestroy {
this.bg = bgItem; this.bg = bgItem;
const leftBg = new MySprite()
leftBg.init(this.images.get("bg_left"));
leftBg.setScaleXY(this.mapScale);
leftBg.x = bgItem.x - bgItem.width / 2 * bgItem.scaleX;
leftBg.y = bgItem.y;
leftBg.anchorX = 1;
const rightBg = new MySprite()
rightBg.init(this.images.get("bg_right"));
rightBg.setScaleXY(this.mapScale);
rightBg.x = bgItem.x + bgItem.width / 2 * bgItem.scaleX;
rightBg.y = bgItem.y;
rightBg.anchorX = 0;
this.renderArr.push(leftBg, rightBg);
// const edge = 20; // const edge = 20;
// const shapeRect = new ShapeRect(); // const shapeRect = new ShapeRect();
// shapeRect.init(); // shapeRect.init();
...@@ -1177,9 +1200,9 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1177,9 +1200,9 @@ export class PlayComponent implements OnInit, OnDestroy {
this.updateArr(this.renderArr); this.updateArr(this.renderArr);
this.updateItem(this.particleLayer); this.updateArr(this.topArr);
this.updateArr(this.endPageArr); // this.updateArr(this.endPageArr);
} }
......
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