Files
slot-machines/src/entities/BasicWin.ts
Andrey Sharshov dfa72178d5 initial
2025-11-16 18:45:28 +01:00

75 lines
1.4 KiB
TypeScript

import { Container, Text } from 'pixi.js';
import { Spine } from 'pixi-spine';
export default class BasicWin extends Container
{
spine: Spine;
betValueText: Text;
isShown: boolean;
constructor()
{
super();
this._create();
}
_create()
{
this.betValueText = new Text();
this.betValueText.style = {
fill: 0xffffff,
stroke: 0x000000,
strokeThickness: 3,
fontSize: 40,
fontFamily: 'Arial',
letterSpacing: 0,
};
this.betValueText.anchor.set(0.5);
this.addChild(this.betValueText);
this.value = '';
this.isShown = false;
this.betValueText.visible = false;
}
get value(): string
{
return this.betValueText.text;
}
set value(formattedValue: string)
{
this.betValueText.text = formattedValue;
}
update(_dt:number)
{
}
show()
{
if (this.isShown) return;
this.betValueText.visible = true;
this.isShown = true;
}
hide()
{
if (!this.isShown) return;
this.isShown = false;
this.betValueText.visible = false;
}
hidden()
{
this.isShown = false;
this.betValueText.visible = false;
}
override destroy(_options?: object)
{
super.destroy(_options);
}
}