补充座驾动画标题用户信息
This commit is contained in:
@@ -447,8 +447,9 @@ const Type99AEffect = (() => {
|
||||
* @param {number} h 画布高度
|
||||
* @param {number} progress 播放进度
|
||||
* @param {string} title 入场标题
|
||||
* @param {string} userInfo 用户身份信息
|
||||
*/
|
||||
function drawHud(ctx, w, h, progress, title) {
|
||||
function drawHud(ctx, w, h, progress, title, userInfo) {
|
||||
const enter = Math.min(1, Math.max(0, (progress - 0.14) / 0.2));
|
||||
const leave = Math.min(1, Math.max(0, (1 - progress) / 0.16));
|
||||
const alpha = easeInOutSine(enter) * leave;
|
||||
@@ -462,16 +463,19 @@ const Type99AEffect = (() => {
|
||||
ctx.fillStyle = "rgba(28,25,23,0.66)";
|
||||
ctx.strokeStyle = "rgba(253,230,138,0.72)";
|
||||
ctx.lineWidth = 2;
|
||||
roundRect(ctx, w * 0.5 - 320, y - 46, 640, 96, 18);
|
||||
roundRect(ctx, w * 0.5 - 340, y - 56, 680, 120, 18);
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
|
||||
ctx.fillStyle = "#fef3c7";
|
||||
ctx.font = "700 16px serif";
|
||||
ctx.fillText("ZTZ-99A ARMORED FORCE", w * 0.5, y - 12);
|
||||
ctx.fillText("ZTZ-99A ARMORED FORCE", w * 0.5, y - 24);
|
||||
ctx.fillStyle = "#fde68a";
|
||||
ctx.font = "700 18px serif";
|
||||
ctx.fillText(userInfo, w * 0.5, y + 8, 620);
|
||||
ctx.fillStyle = "#ffffff";
|
||||
ctx.font = "900 38px serif";
|
||||
ctx.fillText(title, w * 0.5, y + 28, 590);
|
||||
ctx.font = "900 34px serif";
|
||||
ctx.fillText(title, w * 0.5, y + 45, 620);
|
||||
ctx.restore();
|
||||
}
|
||||
|
||||
@@ -513,6 +517,7 @@ const Type99AEffect = (() => {
|
||||
const h = canvas.height;
|
||||
const dust = createDust(w, h);
|
||||
const title = String(options.effect_title || "99A主战坦克 重装入场").trim() || "99A主战坦克 重装入场";
|
||||
const userInfo = String(options.effect_user_info || "").trim();
|
||||
const startTime = performance.now();
|
||||
let animId = null;
|
||||
let finished = false;
|
||||
@@ -556,7 +561,7 @@ const Type99AEffect = (() => {
|
||||
drawDust(ctx, dust, w, progress);
|
||||
drawShockwave(ctx, w, h, progress);
|
||||
drawTank(ctx, tankX, tankY, scale, progress);
|
||||
drawHud(ctx, w, h, progress, title);
|
||||
drawHud(ctx, w, h, progress, title, userInfo);
|
||||
|
||||
if (progress < 1) {
|
||||
animId = requestAnimationFrame(animate);
|
||||
|
||||
Reference in New Issue
Block a user