Commit dfce2cec authored by 李维's avatar 李维

dev commit

parent 27ae58d9
...@@ -49,6 +49,7 @@ const zIndexMap = { ...@@ -49,6 +49,7 @@ const zIndexMap = {
line: 115, line: 115,
longAudioPlay: 110, longAudioPlay: 110,
cardUp: 110, cardUp: 110,
cardBorder: 111,
lianzi: 100, lianzi: 100,
window: 50 window: 50
} }
...@@ -821,6 +822,8 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -821,6 +822,8 @@ export class PlayComponent implements OnInit, OnDestroy {
let A1 = [] let A1 = []
let A2 = [] let A2 = []
let A3 = [] let A3 = []
let A4 = []
let A5 = []
cardAll.forEach((card, index)=>{ cardAll.forEach((card, index)=>{
let pos = {x:0, y:0} let pos = {x:0, y:0}
if(index!=0){ if(index!=0){
...@@ -839,6 +842,8 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -839,6 +842,8 @@ export class PlayComponent implements OnInit, OnDestroy {
A1.push(temp.e1) A1.push(temp.e1)
A2.push(temp.e2) A2.push(temp.e2)
A3.push(temp.e3) A3.push(temp.e3)
A4.push(temp.e4)
A5.push(temp.e5)
}) })
let movedDis = this.alignCenter(A1) let movedDis = this.alignCenter(A1)
A2.forEach(item=>{ A2.forEach(item=>{
...@@ -847,6 +852,12 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -847,6 +852,12 @@ export class PlayComponent implements OnInit, OnDestroy {
A3.forEach(item=>{ A3.forEach(item=>{
item.x = item.x + movedDis item.x = item.x + movedDis
}) })
A4.forEach(item=>{
item.x = item.x + movedDis
})
A5.forEach(item=>{
item.x = item.x + movedDis
})
} }
createCardDown(index, label, pos){ createCardDown(index, label, pos){
...@@ -856,7 +867,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -856,7 +867,7 @@ export class PlayComponent implements OnInit, OnDestroy {
let card = this.g_cartoon.createCartoonElementImageFunc(`card-down-${index}`, "bg_card_down", (w, h)=>{ let card = this.g_cartoon.createCartoonElementImageFunc(`card-down-${index}`, "bg_card_down", (w, h)=>{
return { return {
sx: (label.width + 20)*this.g_mapScale / w, sx: (label.width + 20)*this.g_mapScale / w,
sy: 84*this.g_mapScale / h sy: 108*this.g_mapScale / h
} }
}, (w, h)=>{ }, (w, h)=>{
return { return {
...@@ -865,6 +876,31 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -865,6 +876,31 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
}) })
card.text = label; card.text = label;
let cardBB = card.ref.getBoundingBox()
let borderLeft = this.g_cartoon.createCartoonElementImageFunc(`card-down-border-left-${index}`, "border_left", (w, h)=>{
return {
sx: 10*this.g_mapScale / w,
sy: 108*this.g_mapScale / h
}
}, (w, h)=>{
return {
x: card.ref.x - ((label.width + 20)*this.g_mapScale) / 2,
y: card.ref.y
}
})
let borderRight = this.g_cartoon.createCartoonElementImageFunc(`card-down-border-right-${index}`, "border_right", (w, h)=>{
return {
sx: 10*this.g_mapScale / w,
sy: 108*this.g_mapScale / h
}
}, (w, h)=>{
return {
x: card.ref.x + ((label.width + 20)*this.g_mapScale) / 2,
y: card.ref.y
}
})
borderRight.ref.visible = true
// 连接节点 // 连接节点
let dot = this.g_cartoon.createImage("icon_dian2", (w, h)=>{ let dot = this.g_cartoon.createImage("icon_dian2", (w, h)=>{
...@@ -919,13 +955,17 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -919,13 +955,17 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
}) })
this.render(borderLeft.ref, zIndexMap.cardBorder)
this.render(borderRight.ref, zIndexMap.cardBorder)
this.render(card.ref, zIndexMap.cardUp) this.render(card.ref, zIndexMap.cardUp)
this.render(label, zIndexMap.cardUp) this.render(label, zIndexMap.cardUp)
return { return {
e1: card.ref, e1: card.ref,
e2: label, e2: label,
e3: dot e3: dot,
e4: borderLeft.ref,
e5: borderRight.ref
} }
} }
......
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