Commit 0fad37c7 authored by 李维's avatar 李维

dev commit

parent 3141502e
......@@ -40,10 +40,10 @@ import TWEEN from "@tweenjs/tween.js";
import defauleFormData from '../../assets/play/default/formData/defaultData.js'
const zIndexMap = {
startButton: 900,
startButtonBubbing: 850,
audioSlider: 900
longAudioPlay: 110,
cardUp: 110,
lianzi: 100,
window: 50
}
@Component({
......@@ -182,6 +182,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.initXuanZhuanTai()
this.initTable()
this.initShowWindow()
this.initCard_up()
}
cleanGameVar(){
......@@ -505,7 +506,6 @@ export class PlayComponent implements OnInit, OnDestroy {
longAudio.refreshAudioProgress = ()=>{
slider.enableSlider = false;
let dis = slider.ref.x + (527/2)
console.log(dis)
let per = dis / 527
longAudio.audio.currentTime = longAudio.audio.duration * per
}
......@@ -556,7 +556,7 @@ export class PlayComponent implements OnInit, OnDestroy {
}
this.g_enableMapDown = true;
})
this.render(longAudio.ref, 110)
this.render(longAudio.ref, zIndexMap.longAudioPlay)
}
if(enableShortAudio){
// 音乐内容
......@@ -571,7 +571,7 @@ export class PlayComponent implements OnInit, OnDestroy {
y: -80
}
})
shortAudio.play = this.g_cartoon.createAnimation("icon_laba", 3, 200)
shortAudio.play = this.g_cartoon.createAnimation("icon_laba", 3, 500)
shortAudio.play.x = -50;
shortAudio.play.y = -7;
shortAudio.ref.addChild(shortAudio.play)
......@@ -600,13 +600,105 @@ export class PlayComponent implements OnInit, OnDestroy {
element.ref.addChild(shortAudio.ref)
}
this.render(lianzi.ref, 100)
this.render(element.ref, 50)
this.render(lianzi.ref, zIndexMap.lianzi)
this.render(element.ref, zIndexMap.window)
}
initCard_up(){
let xuanzhuanTai = this.g_cartoon.getCartoonElement("XuanZhuanTai")
let cardAll = []
this.g_formData.textUp.forEach(item => {
let labelText = this.g_cartoon.createLabel(item.text, "BRLNSR_1", "#634846", 50)
labelText.setScaleXY(this.g_mapScale)
labelText.refreshSize();
cardAll.push(labelText)
});
let spaceing = 10 * this.g_mapScale;
let totalWidth = 0
let totalNum = cardAll.length
cardAll.forEach((element, index) => {
console.log("Label width:" + element.width)
if(index==0 || index==(totalNum-1)){
totalWidth += (element.width/2) + spaceing
}else{
totalWidth += (element.width) + spaceing
}
});
let baseFontsize = 50
let fontSize = 50;
let adjustSX = 1
if(totalWidth > 1214){
// adjustSX = (1200 / totalWidth)
fontSize = baseFontsize * (1214 / (totalWidth * 1.65))
}
console.log(totalWidth, fontSize)
cardAll.forEach((card, index)=>{
card.fontSize = fontSize
card.refreshSize()
})
let lastWidth = 0
let cardX = xuanzhuanTai.ref.x - (xuanzhuanTai.ref.width*this.g_mapScale)/2 + 100 * this.g_mapScale
cardAll.forEach((card, index)=>{
let pos = {x:0, y:0}
if(index!=0){
pos = {
x: cardX + ((card.width + 20) * this.g_mapScale)/2, y: xuanzhuanTai.ref.y + 10 * this.g_mapScale
}
cardX = cardX + (card.width + 20) * this.g_mapScale + 20 * this.g_mapScale
}else{
pos = {
x: cardX, y: xuanzhuanTai.ref.y + 10 * this.g_mapScale
}
cardX = cardX + ((card.width + 20) * this.g_mapScale)/2 + 20 * this.g_mapScale
}
this.createCardUp(index, card, pos)
})
}
createCardUp(index, label, pos){
pos.y = pos.y + 20*this.g_mapScale
label.x = pos.x
label.y = pos.y
let card = this.g_cartoon.createCartoonElementImageFunc(`card-up-${index}`, "bg_kuang1", (w, h)=>{
return {
sx: (label.width + 20)*this.g_mapScale / w,
sy: 84*this.g_mapScale / h
}
}, (w, h)=>{
return {
x: pos.x,
y: pos.y
}
})
let panzi = this.g_cartoon.createImage("pan_zi", (w, h)=>{
return {
sx: 98*this.g_mapScale / w,
sy: 70*this.g_mapScale / h
}
}, (w, h)=>{
return {
x: pos.x,
y: pos.y + (84*this.g_mapScale)/2
}
})
card.text = label;
card.panzi = panzi;
this.render(panzi, zIndexMap.cardUp)
this.render(card.ref, zIndexMap.cardUp)
this.render(label, zIndexMap.cardUp)
}
......
......@@ -63,6 +63,9 @@ const localImages = {
'bg_main_window': 'assets/play/bg_main_window.png',
'default_Image': 'assets/play/Default_Image.png',
'audio_play_click': 'assets/play/audio_play_click.png',
'bg_card_down': 'assets/play/bg_card_down.png',
'border_left': 'assets/play/border_left.png',
'border_right': 'assets/play/border_right.png',
'bg_star (1)': 'assets/play/frame/bg_star (1).png',
'bg_star (10)': 'assets/play/frame/bg_star (10).png',
......
......@@ -8,8 +8,15 @@ export default {
shortAudio_url: "default_short_audio",
longAudio_url: "default_long_audio"
},
// textUp:[
// {text:"make friends", lineTo:""},{text:"lound", lineTo:""},{text:"we eat ice cream", lineTo:""},{text:"very happy", lineTo:""},
// {text:"make friends", lineTo:""},{text:"lound", lineTo:""},{text:"we eat ice cream", lineTo:""},{text:"very happy", lineTo:""},
// {text:"make friends", lineTo:""},{text:"lound", lineTo:""},{text:"we eat ice cream", lineTo:""},{text:"very happy", lineTo:""}
// ],
textUp:[
{text:"make friends", lineTo:""},{text:"lound", lineTo:""},{text:"we eat ice cream", lineTo:""},{text:"very happy", lineTo:""}
{text:"make friends", lineTo:""},{text:"lound", lineTo:""},{text:"we eat ice cream", lineTo:""},{text:"very happy", lineTo:""},
{text:"make friends", lineTo:""},{text:"lound", lineTo:""},{text:"we eat ice cream", lineTo:""},{text:"very happy", lineTo:""},
{text:"make friends", lineTo:""}
],
textDown:[
{text:"it's so much fun", lineTo:""},{text:"lound", lineTo:""},{text:"very happy", lineTo:""},{text:"sun", lineTo:""},{text:"at the park", lineTo:""}
......
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