Skip to content

Commit

Permalink
minor performance optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
konekowo committed Sep 26, 2024
1 parent c225cf0 commit 20569ae
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Elements/AudioVisualizers/LogoVisualizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ export class LogoVisualizer extends PIXI.Container {
private indexOffset = 0;
private firstDraw = true;

public set alpha(number: number) {
super.alpha = number * 0.2;
}
public get alpha() {
return super.alpha * 5;
}

public constructor() {
super();
this.alpha = 1;
}

public start() {
this.graphics.blendMode = "add";
this.addChild(this.graphics);
Expand Down Expand Up @@ -80,7 +92,7 @@ export class LogoVisualizer extends PIXI.Container {

this.graphics.moveTo(barPosition.x, barPosition.y);
this.graphics.lineTo(barPosition.x + amplitudeOffset.x, barPosition.y + amplitudeOffset.y);
this.graphics.stroke({color: "rgba(255, 255, 255, 0.2)", width: 14});
this.graphics.stroke({color: "rgb(255, 255, 255)", width: 14});
}
}
this.firstDraw = false;
Expand Down

0 comments on commit 20569ae

Please sign in to comment.