File size: 1,123 Bytes
3ed48fd a812266 3ed48fd 2a8b3b0 3ed48fd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
import { BaseEffect } from './base.js';
export class MultilineNeonEffect extends BaseEffect {
constructor() {
super();
this.glowOptions = {
color: '#00ffff',
blur: 90,
iterations: 6
};
this.strokeOptions = {
color: '#ffffff',
width: 1
};
}
async setupContext(ctx, options) {
ctx.font = `${options.fontSize}px "${options.font}"`;
ctx.textBaseline = 'top';
ctx.fillStyle = '#00ffff'; // シアン色のメインカラー
}
async applySpecialEffect(ctx, canvas, options) {
// 追加のネオン効果(オプション)
ctx.globalCompositeOperation = 'lighter';
ctx.shadowBlur = 10;
ctx.shadowColor = '#00ffff';
ctx.globalAlpha = 0.3;
// 既に描画されたテキストの上に薄く重ねて光る効果を追加
await this.renderMainText(ctx);
// 設定を元に戻す
ctx.globalCompositeOperation = 'source-over';
ctx.shadowBlur = 0;
ctx.globalAlpha = 1.0;
}
} |