This commit is contained in:
Andrey Sharshov
2025-11-16 18:45:28 +01:00
commit dfa72178d5
187 changed files with 39934 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
import {BitmapText} from 'pixi.js';
import { SymbolConfig } from '../types/SlotMachineConfig';
import ReelSymbol from './ReelSymbol';
export default class ValuableReelSymbol extends ReelSymbol
{
private textObj: BitmapText;
private _value: number;
constructor(config: SymbolConfig)
{
super(config);
}
public set value(v: number)
{
if (v <= 0) return;
!this.textObj && this.createValueText();
this._value = v;
if (this.textObj) {
this.textObj.text = `X${v}`;
}
}
public get value(): number
{
return this._value;
}
private createValueText()
{
if (!this.config.fontStyle || !this.config.fontStyle.fontName) return;
this.textObj = new BitmapText(`X${this.config.value}`, this.config.fontStyle);
this.textObj.anchor.set(0.5);
this.textObj.scale.set(1, -1);
const slotIndex = this.spine.skeleton.findSlotIndex('value');
this.spine.slotContainers[slotIndex].addChild(this.textObj);
}
public override tint(hexColor: number): void
{
super.tint(hexColor);
if (this.textObj)
{
this.textObj.tint = hexColor;
}
}
}