Commit 5e08e4d3 authored by Edwise's avatar Edwise 🍷

1234

parent 6c928df7
......@@ -2,9 +2,9 @@
"success": true,
"message":"",
"data": {
"catType": 1,
"catType": 2,
"userNick": "Edwise",
"energy": 1000,
"energy": 100,
"happyCoin":1000,
"experience": 50,
"level": "1",
......
......@@ -91,7 +91,7 @@ class Waiting extends FYGE.Container {
}
show(msg: string = "加载中") {
this.msg.text = msg;
// this.msg.text = msg;
}
destroy() {
......
......@@ -652,6 +652,12 @@ const resCanvasList = {
ext: '.png',
url: 'https://yun.duiba.com.cn/spark/assets/LetterTexture.78192e79fa3b21a85b245038f23561eeb5141d4d.png',
uuid: '3b12798d-d932-4f5b-a442-6e4877ba5c16'
},
'624e8c63-963f-4b20-9802-b0fb006fbf93': {
name: 'catTalkDialog',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/catTalkDialog.6fa85b0929d7d8e0d42d0d30587cdbdc33059a8f.png',
uuid: '624e8c63-963f-4b20-9802-b0fb006fbf93'
}
};
export default resCanvasList;
......@@ -44,12 +44,15 @@ export class Cat extends Module {
catAnimArr: FYGE.Lottie[] = []; //猫咪lottie实例组
catLottieArr: any //猫咪lottie数据组
actRunning: boolean = false; //动效是否进行中,如果动效进行中,无法进行其他动效
dialog:FYGE.Sprite; //猫咪对话框气泡
dialogText:FYGE.TextField; //猫咪对话框气泡文字内容
initUi() {
this.initCatLottieArr();
console.log(this.catLottieArr);
this.initCat();
this.setCatAnimShow(0);
this.initDialog();
this.setCatAnimShow(1);
this.initEvents();
}
......@@ -66,7 +69,7 @@ export class Cat extends Module {
},
"orenge": {
sleep: jumao01,
talk: jumaoshumao,
talk: jumaoshuohua,
clear: jumaoshumao,
rua: jumaolumao04,
play: jumaowanshua,
......@@ -119,7 +122,31 @@ export class Cat extends Module {
that.catAnimArr.push(that.cat_touch);
}
curAnim: number = 0;
/**初始化对话框 */
initDialog(){
var that = this;
that.dialog = Ins.initSprite("624e8c63-963f-4b20-9802-b0fb006fbf93");
that.dialog.position.set(280,526)
that.addChild(that.dialog);
that.dialogText = Ins.initLabel({size:24,x:30,y:20});
that.dialogText.textWidth = 280;
that.dialog.addChild(that.dialogText);
that.dialogText.text = "哈哈哈哈哈哈哈哈哈哈哈\n哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈";
console.log("最大长度为"+that.dialogText.text.length)
that.dialog.visible = false;
}
/**显示对话框 */
showDialog(msg:string){
this.dialogText.text = msg;
this.dialog.visible = true;
}
/**隐藏对话框 */
hideDialog(){
this.dialog.visible = false;
}
/**根据index显示猫咪动画
* 0:睡觉,1:说话,2:梳毛,3:撸猫,4:玩球,5:摸头
*/
......@@ -156,17 +183,17 @@ export class Cat extends Module {
case CAT_ACTTYPEP.SLEEP:
break;
default:
that.setCatAnimShow(actType, () => { that.setCatAnimShow(0, null) });
that.setCatAnimShow(actType, () => {
that.hideDialog();
that.setCatAnimShow(0, null)
});
break;
}
}else
{
// FYGE.GDispatcher.dispatchEvent("23",r.message)
showToast(r.message)
}
})
}
initEvents() {
......
......@@ -13,6 +13,8 @@ export class RulePanel extends Panel{
this.y = (Ins.stageH - bg.height)>>1;
var ruleLabel = Ins.initLabel({size:24,text:"规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则"})
var ruleView = new FYGE.ScrollPage(574,279,ruleLabel.textHeight)
ruleLabel.textWidth = 570;
// ruleLabel.
ruleView.isSpringBack = false;
ruleView.x = 76;
ruleView.y = 167;
......
......@@ -78,7 +78,7 @@ export class MainScene extends Scene {
/**初始化猫咪 */
initCat() {
var that = this;
that.cat = new Cat({ type: "xianluo" });
that.cat = new Cat({ type: "orenge" });
that.addChild(that.cat);
if (Ins.catIsOut) {
that.cat.visible = false;
......@@ -141,7 +141,7 @@ export class MainScene extends Scene {
var that = this;
that.energy = Ins.userInfo.energy;
that.energyImg.scaleX = (that.energy / that.maxEnergy);
that.energyDeco.x = that.energyImgW * that.energyImg.scaleX - that.energyDeco.width * 0.5;
that.energyDeco.x = that.energyImgW * that.energyImg.scaleX - that.energyDeco.width * 0.2;
that.energyLabel.text = "精力" + that.energy + "/" + that.maxEnergy;
that.energyLabel.x = (that.energyGroup.width - that.energyLabel.textWidth) / 2
}
......
......@@ -43,6 +43,7 @@ export class MainSceneBtnUi extends Module {
private catAvatar: FYGE.Sprite; //猫猫头像
private catNameLabel: FYGE.TextField; //猫猫名称文本
private catLevelLabel: FYGE.TextField; //猫猫等级文本
private catExperience:FYGE.TextField; //经验值文本
/**鱼鱼积分组 */
private fishPointGroup: FYGE.Sprite;
private fishPointLabel: FYGE.TextField; //鱼鱼积分文本
......@@ -101,10 +102,8 @@ export class MainSceneBtnUi extends Module {
var mask = new FYGE.Shape();
mask.beginFill(6, 1);
mask.drawCircle(0, 0, 24)
// mask.drawRoundedRect(0, 0, 52, 52, 38, 38, 38, 38);
mask.endFill();
mask.x = 33;
mask.y = 33;
mask.position.set(33,33)
that.catInfoGroup.addChild(mask);
that.catAvatar.mask = mask;
......@@ -113,6 +112,8 @@ export class MainSceneBtnUi extends Module {
that.catLevelLabel = Ins.initLabel({ color: "black", size: 24, text: "Lv.1", x: (192 - 19), y: (167 - 145) })
that.catInfoGroup.addChild(that.catLevelLabel);
// that.catLevelLabel
}
/**初始化鱼鱼积分组 */
......
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