Commit b3041a1d authored by Tt's avatar Tt

修改动画效果

parent f746ab83
...@@ -118,13 +118,32 @@ cc.Class({ ...@@ -118,13 +118,32 @@ cc.Class({
}, },
preload() { preload() {
// const preloadArr = this._imageResList.concat(this._audioResList).concat(this._animaResList);
const preloadArr = this._imageResList.concat(this._audioResList).concat(this._animaResList); // cc.assetManager.loadAny(preloadArr, null, null, (err, data) => {
// this.loadEnd();
// if (window && window["air"]) {
// window["air"].hideAirClassLoading();
// }
// cc.debug.setDisplayStats(false);
// });
const preloadArr = [
...this._imageResList,
...this._audioResList,
...this._animaResList
];
cc.assetManager.loadAny(preloadArr, null, null, (err, data) => { cc.assetManager.loadAny(preloadArr, null, null, (err, data) => {
this.loadEnd();
if (window && window["air"]) { if (window && window["air"]) {
window["air"].hideAirClassLoading(); cc.find('Canvas').opacity = 0;
window.air.onCourseInScreen = (next) => {
cc.find('Canvas').opacity = 255;
this.loadEnd();
next();
}
window.air.hideAirClassLoading();
} else {
this.loadEnd();
} }
cc.debug.setDisplayStats(false); cc.debug.setDisplayStats(false);
...@@ -302,24 +321,39 @@ cc.Class({ ...@@ -302,24 +321,39 @@ cc.Class({
let itemfirst = pg.view.find(item, "first"); let itemfirst = pg.view.find(item, "first");
//动态居中算法。 //动态居中算法。
//锚点在中间,左右延长,第一个字不去显示 //锚点在中间,左右延长,第一个字不去显示
let contentArr = content.split(""); let contentArr = content.split("");
let s0 = contentArr.shift(); let s0 = contentArr.shift();
let s1 = contentArr.join(""); let s1 = contentArr.join("");
//首字母变大 //首字母变大
let str1 = `<size=150><color=#ffffff>${s0}</color></size><color=#0000>${s1}</color>` let count = 100;
let strfirst1 = `<size=150><color=#fc4a4a>${s0}</color></size>`; let max = 150;
let str1 = `<size=${max}><color=#ffffff>${s0}</color></size><size=${count}><color=#0000>${s1}</color></size>`
let strfirst1 = `<size=${max}><color=#fc4a4a>${s0}</color></size>`;
item.getComponent(cc.RichText).string = str1; item.getComponent(cc.RichText).string = str1;
itemfirst.y = 17; itemfirst.y = 17;
itemfirst.getComponent(cc.RichText).string = strfirst1; itemfirst.getComponent(cc.RichText).string = strfirst1;
setTimeout(() => { setTimeout(() => {
//全部变大 let times = 20;
let str2 = `<size=150><color=#ffffff>${s0}</color><color=#0000>${s1}</color></size>` let time = 0;
let inter = setInterval(() => {
time++;
let nowCount = count + (max - count) * (time / times);
if (nowCount >= 150) {
nowCount = 150;
clearInterval(inter);
}
let str2 = `<size=${max}><color=#ffffff>${s0}</color></size><size=${nowCount}><color=#0000>${s1}</color></size>`
itemfirst.y = 0; itemfirst.y = 0;
item.getComponent(cc.RichText).string = str2; item.getComponent(cc.RichText).string = str2;
}, 30);
}, 1100); }, 1100);
// setTimeout(() => {
// //全部变大
// let str2 = `<size=150><color=#ffffff>${s0}</color><color=#0000>${s1}</color></size>`
// itemfirst.y = 0;
// item.getComponent(cc.RichText).string = str2;
// }, 1100);
}, },
//按钮触发,使用的方法 //按钮触发,使用的方法
......
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