Commit 178c8d28 authored by 李维's avatar 李维

dev commit

parent bd59ce3a
This diff is collapsed.
......@@ -313,7 +313,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.m_questionCard_All.push(this.createQuestionCardText(index, element))
});
this.m_questionCard_All = this.randomArray_shuffle(this.m_questionCard_All)
this.alignCenter(this.m_questionCard_All, 20*this.g_mapScale, true)
this.alignCenter(this.m_questionCard_All, 40*this.g_mapScale, true)
}
createQuestionCardText(index, text){
......@@ -324,16 +324,25 @@ export class PlayComponent implements OnInit, OnDestroy {
element.index = index;
// 高亮边框 新
let borderWidth = imageBD.width + 30 * this.g_mapScale
let borderHeight = cardHeight * this.g_mapScale
let border_new = this.g_cartoon.createRectangula({
x: -borderWidth / 2, y: -borderHeight / 2, width: borderWidth, height: borderHeight, fillColor: "#66e4ff", radius: 10
})
border_new.visible = false;
element.ref.addChild(border_new)
// 边框
let borderLeft = this.g_cartoon.createCartoonElementImageFunc("questioncard-text-border-left-"+index, "image_border_left", (w, h)=>{
return{
sx: (22 / element.ref.scaleX) / w,
sy: (((cardHeight - 8) * this.g_mapScale) / element.ref.scaleY) / h
sy: (cardHeight - 8) * this.g_mapScale / h
}
}, (w, h)=>{
return{
x: -(imageBD.width / element.ref.scaleX) / 2,
y: 13
x: -imageBD.width / 2,
y: 0
}
})
element.ref.addChild(borderLeft.ref)
......@@ -341,12 +350,12 @@ export class PlayComponent implements OnInit, OnDestroy {
let borderRight = this.g_cartoon.createCartoonElementImageFunc("questioncard-text-border-right-"+index, "image_border_right", (w, h)=>{
return{
sx: (22 / element.ref.scaleX) / w,
sy: (((cardHeight - 8) * this.g_mapScale) / element.ref.scaleY) / h
sy: ((cardHeight - 8) * this.g_mapScale) / h
}
}, (w, h)=>{
return{
x: (imageBD.width / element.ref.scaleX) / 2,
y: 13
y: 0
}
})
element.ref.addChild(borderRight.ref)
......@@ -354,65 +363,21 @@ export class PlayComponent implements OnInit, OnDestroy {
let border = this.g_cartoon.createCartoonElementImageFunc("questioncard-text-border-"+index, "text_center", (w, h)=>{
return{
sx: (imageBD.width / element.ref.scaleX) / w,
sy: ((cardHeight * this.g_mapScale) / element.ref.scaleY) / h
sy: (cardHeight * this.g_mapScale) / h
}
}, (w, h)=>{
return{
x: 0,
y: 13
y: 0
}
})
element.ref.addChild(border.ref)
// 高亮边框
let border_H = this.g_cartoon.createCartoonElementImageFunc("questioncard-text-border-h-"+index, "border_center", (w, h)=>{
return{
sx: (imageBD.width / element.ref.scaleX) / w,
sy: ((cardHeight * this.g_mapScale) / element.ref.scaleY) / h
}
}, (w, h)=>{
return{
x: 0,
y: 8
}
})
element.ref.addChild(border_H.ref)
let borderLeft_H = this.g_cartoon.createCartoonElementImageFunc("questioncard-text-border-h-left-"+index, "border_left", (w, h)=>{
return{
sx: (22 / element.ref.scaleX) / w,
sy: ((cardHeight * this.g_mapScale) / element.ref.scaleY) / h
}
}, (w, h)=>{
return{
x: -(imageBD.width / element.ref.scaleX) / 2 - 5,
y: 9
}
})
element.ref.addChild(borderLeft_H.ref)
let borderRight_H = this.g_cartoon.createCartoonElementImageFunc("questioncard-text-border-h-right-"+index, "border_right", (w, h)=>{
return{
sx: (22 / element.ref.scaleX) / w,
sy: ((cardHeight * this.g_mapScale) / element.ref.scaleY) / h
}
}, (w, h)=>{
return{
x: (imageBD.width / element.ref.scaleX) / 2 + 5,
y: 9
}
})
element.ref.addChild(borderRight_H.ref)
element.text_copy = this.g_cartoon.createCartoonElementLabel("questioncard-text-"+index+"-copy", text,"BRLNSDB", "#d94158", 65 * this.g_mapScale, 0, 0)
element.text_copy_shadow = this.g_cartoon.createCartoonElementLabel("questioncard-text-"+index+"-copy", text,"BRLNSDB", "#fdf0cd", 65 * this.g_mapScale, 0, 5)
element.ref.addChild(element.text_copy_shadow.ref)
element.ref.addChild(element.text_copy.ref)
border_H.ref.visible = false;
borderRight_H.ref.visible = false;
borderLeft_H.ref.visible = false;
element.startPos = { x:element.initX, y:element.initY }
element.backTo = (pos?, callback?)=>{
if(pos){
......@@ -430,9 +395,7 @@ export class PlayComponent implements OnInit, OnDestroy {
element.release = (pos, callback?)=>{
this.m_enableCardMove = false;
this.m_currentSelectedCardID = null;
border_H.ref.visible = false;
borderRight_H.ref.visible = false;
borderLeft_H.ref.visible = false;
border_new.visible = false;
this.disableMoveAsstant()
element.backTo(pos, callback)
}
......@@ -445,9 +408,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.g_cartoon.playAudio("tuozhuai")
this.m_enableCardMove = true;
this.m_currentSelectedCardID = element.id
border_H.ref.visible = true;
borderRight_H.ref.visible = true;
borderLeft_H.ref.visible = true;
border_new.visible = true;
this.topOfRenderArray(element.ref)
element.startPos = {
x: this.g_clickX,
......@@ -700,12 +661,12 @@ export class PlayComponent implements OnInit, OnDestroy {
if(selectedCard.index == element.index){
selectedCard.ref.x = element.ref.x
selectedCard.ref.y = element.ref.y
selectedCard.release({x:element.ref.x, y:element.ref.y - 10 * this.g_mapScale}, ()=>{
selectedCard.release({x:element.ref.x, y:element.ref.y}, ()=>{
let spacing = 0
if(this.g_formData.answerType=="Image"){
spacing = 20*this.g_mapScale
}else{
spacing = 20*this.g_mapScale
spacing = 30*this.g_mapScale
}
this.alignCenter(this.m_answerCard_All, spacing, true, ()=>{
element.star(()=>{
......
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