图块和视角变速移动

This commit is contained in:
ckcz123 committed 2021-07-26 18:16:24 +08:00
1 parent 2ae21a0bca
commit a6d74c00aa
9 files changed
+80 -37

No files matched your search

+21
View File
@@ -480,6 +480,27 @@ utils.prototype.formatBigNumber = function (x, onMap) {
return c + x;
}
////// 变速移动 //////
utils.prototype.applyEasing = function(name) {
var list = {
"easeIn": function(t) {
return Math.pow(t, 3);
},
"easeOut": function(t) {
return 1 - Math.pow(1 - t, 3);
},
"easeInOut": function(t) {
// easeInOut试了一下感觉二次方效果明显点
if (t < 0.5) return Math.pow(t, 2) * 2;
else return 1 - Math.pow(1 - t, 2) * 2;
},
"linear": function(t) {
return t
}
}
return list[name] || list.linear;
}
////// 数组转RGB //////
utils.prototype.arrayToRGB = function (color) {
if (!(color instanceof Array)) return color;