更改warning插件,调整镜头和相关变量
This commit is contained in:
parent
bb41bad059
commit
2c790053c7
@ -14895,9 +14895,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
||||
};
|
||||
},
|
||||
"warning": function () {
|
||||
// 在此增加新插件
|
||||
// 默认音效名
|
||||
var defaultSound = "jingbao.opus";
|
||||
var defaultSound = "jingbao.mp3";
|
||||
// 默认字体名
|
||||
var defaultFont = "Verdana";
|
||||
|
||||
@ -14907,10 +14906,10 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
||||
* @param {number} y 纵坐标
|
||||
* @param {string} text 显示的文字
|
||||
*/
|
||||
this.drawWarning = function (x, y, size, text, text2, warning) {
|
||||
this.drawWarning = function (x, y, text, text2, warning, large = 2, size = 36) {
|
||||
if (timeout) return;
|
||||
x = x ?? 6;
|
||||
y = y ?? 6;
|
||||
y = y ?? 6
|
||||
text = text || "boss";
|
||||
text += "</br>";
|
||||
for (var i = 0; i < 10; i++) text += " ";
|
||||
@ -14934,26 +14933,73 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
||||
t.style.left = 416 * core.domStyle.scale + "px";
|
||||
}, 50);
|
||||
// 计算偏移量
|
||||
var px = ((6 - x) / 12) * 50;
|
||||
var py = ((6 - y) / 12) * 50;
|
||||
var px = ((6 - x) / 12) * (100 - 100 / large + 2);
|
||||
var py = ((6 - y) / 12) * (100 - 100 / large + 2);
|
||||
// 修改画布的scale和transform
|
||||
elements.forEach(function (v) {
|
||||
if (v instanceof HTMLCanvasElement) {
|
||||
v.style.transform = "scale(2)translate(" + px + "%, " + py + "%)";
|
||||
let time = 0;
|
||||
let s = 1;
|
||||
let sx = 0;
|
||||
let sy = 0;
|
||||
let cishu = 1;
|
||||
core.registerAnimationFrame("big", true, function (temptime) {
|
||||
if (temptime - time > 10) {
|
||||
|
||||
time = temptime;
|
||||
s += (large - 1) / 30;
|
||||
sx += px / 30;
|
||||
sy += py / 30;
|
||||
elements.forEach(function (v) {
|
||||
if (v instanceof HTMLCanvasElement) {
|
||||
v.style.transform = "scale(" + s + ")translate(" + sx + "%, " + sy + "%)";
|
||||
|
||||
}
|
||||
});
|
||||
cishu++;
|
||||
if (cishu == 30) {
|
||||
core.unregisterAnimationFrame("big");
|
||||
console.log(sx);
|
||||
console.log(sy)
|
||||
}
|
||||
}
|
||||
});
|
||||
if (!warning) core.playSound(defaultSound);
|
||||
// 拉回镜头
|
||||
timeout = setTimeout(function () {
|
||||
timeout = setTimeout(function () {
|
||||
timeout = void 0;
|
||||
core.dom.gameDraw.removeChild(t);
|
||||
}, 1500);
|
||||
elements.forEach(function (v) {
|
||||
if (v instanceof HTMLCanvasElement) {
|
||||
v.style.transform = "none";
|
||||
// timeout = setTimeout(function () {
|
||||
// timeout = void 0;
|
||||
// core.dom.gameDraw.removeChild(t);
|
||||
// }, 1500);
|
||||
let time2 = 0;
|
||||
let s2 = large - (large - 1) / 30;
|
||||
let sx2 = px;
|
||||
let sy2 = py;
|
||||
let cishu2 = 1;
|
||||
core.registerAnimationFrame("small", true, function (temptime) {
|
||||
if (temptime - time2 > 10) {
|
||||
|
||||
time2 = temptime;
|
||||
s2 -= (large - 1) / 30;
|
||||
sx2 -= px / 30;
|
||||
sy2 -= py / 30;
|
||||
elements.forEach(function (v) {
|
||||
if (v instanceof HTMLCanvasElement) {
|
||||
v.style.transform = "scale(" + s2 + ")translate(" + sx2 + "%, " + sy2 + "%)";
|
||||
|
||||
}
|
||||
});
|
||||
cishu2++;
|
||||
if (cishu2 == 30) {
|
||||
core.unregisterAnimationFrame("small")
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
// elements.forEach(function (v) {
|
||||
// if (v instanceof HTMLCanvasElement) {
|
||||
// v.style.transform = "none";
|
||||
// }
|
||||
// });
|
||||
|
||||
}, 1600);
|
||||
};
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user