@truelab/truengine 0.0.1-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/truengine.es.js +35354 -0
  2. package/dist/types/index.d.ts +2 -0
  3. package/dist/types/src/classes/assets.class.d.ts +89 -0
  4. package/dist/types/src/classes/bitmap.text.class.d.ts +77 -0
  5. package/dist/types/src/classes/borderview.class.d.ts +204 -0
  6. package/dist/types/src/classes/color.class.d.ts +72 -0
  7. package/dist/types/src/classes/container.class.d.ts +111 -0
  8. package/dist/types/src/classes/di.class.d.ts +110 -0
  9. package/dist/types/src/classes/emitter.class.d.ts +64 -0
  10. package/dist/types/src/classes/engine.class.d.ts +75 -0
  11. package/dist/types/src/classes/loaders.class.d.ts +28 -0
  12. package/dist/types/src/classes/preloader.class.d.ts +15 -0
  13. package/dist/types/src/classes/producer.class.d.ts +135 -0
  14. package/dist/types/src/classes/sequence.class.d.ts +30 -0
  15. package/dist/types/src/classes/skipable.class.d.ts +15 -0
  16. package/dist/types/src/classes/spine.assets.class.d.ts +42 -0
  17. package/dist/types/src/classes/tile.class.d.ts +38 -0
  18. package/dist/types/src/components/abstract.component.d.ts +52 -0
  19. package/dist/types/src/components/abstract.html.component.d.ts +43 -0
  20. package/dist/types/src/components/bigwin.component.d.ts +109 -0
  21. package/dist/types/src/components/blackout.component.d.ts +32 -0
  22. package/dist/types/src/components/button.component.d.ts +113 -0
  23. package/dist/types/src/components/button.faded.component.d.ts +29 -0
  24. package/dist/types/src/components/button.text.component.d.ts +49 -0
  25. package/dist/types/src/components/cheat.component.d.ts +63 -0
  26. package/dist/types/src/components/fillframe.component.d.ts +37 -0
  27. package/dist/types/src/components/fps.component.d.ts +39 -0
  28. package/dist/types/src/components/grid.component.d.ts +28 -0
  29. package/dist/types/src/components/link.component.d.ts +78 -0
  30. package/dist/types/src/components/particles.component.d.ts +30 -0
  31. package/dist/types/src/components/progress.component.d.ts +42 -0
  32. package/dist/types/src/components/slideshow/slides.reel.component.d.ts +65 -0
  33. package/dist/types/src/components/slideshow/slideshow.component.d.ts +27 -0
  34. package/dist/types/src/components/slideshow/slideshow.ui.component.d.ts +28 -0
  35. package/dist/types/src/components/slideshow/slideshow.ui.pagination.d.ts +30 -0
  36. package/dist/types/src/components/slot/coefficient/coefficient.component.d.ts +66 -0
  37. package/dist/types/src/components/slot/frames/frames.component.d.ts +39 -0
  38. package/dist/types/src/components/slot/frames/frames.sequence.component.d.ts +17 -0
  39. package/dist/types/src/components/slot/frames/frames.spine.component.d.ts +21 -0
  40. package/dist/types/src/components/slot/hints/hints.component.d.ts +102 -0
  41. package/dist/types/src/components/slot/intrigue/intrigue.component.d.ts +41 -0
  42. package/dist/types/src/components/slot/intrigue/intrigue.spine.component.d.ts +18 -0
  43. package/dist/types/src/components/slot/lines/lines.component.d.ts +29 -0
  44. package/dist/types/src/components/slot/lines/lines.static.component.d.ts +38 -0
  45. package/dist/types/src/components/slot/reel.component.d.ts +253 -0
  46. package/dist/types/src/components/slot/slot.cheats.d.ts +22 -0
  47. package/dist/types/src/components/slot/slot.component.d.ts +132 -0
  48. package/dist/types/src/components/slot/slot.config.d.ts +82 -0
  49. package/dist/types/src/components/slot/symbol/symbol.component.d.ts +84 -0
  50. package/dist/types/src/components/slot/symbol/symbol.sequence.component.d.ts +18 -0
  51. package/dist/types/src/components/slot/symbol/symbol.spine.component.d.ts +18 -0
  52. package/dist/types/src/components/switch.component.d.ts +62 -0
  53. package/dist/types/src/components/text.component.d.ts +101 -0
  54. package/dist/types/src/components/volatility/volatility.component.d.ts +55 -0
  55. package/dist/types/src/components/volatility/volatility.symbol.component.d.ts +20 -0
  56. package/dist/types/src/extends/enum.types.d.ts +36 -0
  57. package/dist/types/src/extends/interfaces.d.ts +74 -0
  58. package/dist/types/src/extends/javascript.d.ts +5 -0
  59. package/dist/types/src/extends/short.types.d.ts +68 -0
  60. package/dist/types/src/extends/struct.types.d.ts +260 -0
  61. package/dist/types/src/functions/agent.funcs.d.ts +84 -0
  62. package/dist/types/src/functions/animate/counter.func.d.ts +10 -0
  63. package/dist/types/src/functions/animate/fadein.func.d.ts +8 -0
  64. package/dist/types/src/functions/animate/fadeout.func.d.ts +8 -0
  65. package/dist/types/src/functions/animate/from.func.d.ts +10 -0
  66. package/dist/types/src/functions/animate/fromto.func.d.ts +11 -0
  67. package/dist/types/src/functions/animate/to.func.d.ts +10 -0
  68. package/dist/types/src/functions/array/indexofall.func.d.ts +2 -0
  69. package/dist/types/src/functions/array/position.func.d.ts +6 -0
  70. package/dist/types/src/functions/array/unique.func.d.ts +6 -0
  71. package/dist/types/src/functions/arraysintersect.func.d.ts +2 -0
  72. package/dist/types/src/functions/cache.funcs.d.ts +20 -0
  73. package/dist/types/src/functions/cheats.func.d.ts +2 -0
  74. package/dist/types/src/functions/convert/tofixed.func.d.ts +9 -0
  75. package/dist/types/src/functions/debug/container.func.d.ts +7 -0
  76. package/dist/types/src/functions/debug/line.func.d.ts +10 -0
  77. package/dist/types/src/functions/demotexture.func.d.ts +3 -0
  78. package/dist/types/src/functions/dom.funcs.d.ts +6 -0
  79. package/dist/types/src/functions/draw/canvasExtract.func.d.ts +16 -0
  80. package/dist/types/src/functions/draw/gradient.texture.func.d.ts +14 -0
  81. package/dist/types/src/functions/draw/radialGradient.func.d.ts +20 -0
  82. package/dist/types/src/functions/draw/rect.func.d.ts +12 -0
  83. package/dist/types/src/functions/draw/reel.func.d.ts +9 -0
  84. package/dist/types/src/functions/engine.funcs.d.ts +63 -0
  85. package/dist/types/src/functions/is.funcs.d.ts +16 -0
  86. package/dist/types/src/functions/math.funcs.d.ts +38 -0
  87. package/dist/types/src/functions/number/between.func.d.ts +7 -0
  88. package/dist/types/src/functions/object/deepMerge.d.ts +7 -0
  89. package/dist/types/src/functions/random/exclude.func.d.ts +6 -0
  90. package/dist/types/src/functions/random/inrange.func.d.ts +6 -0
  91. package/dist/types/src/functions/random/value.func.d.ts +10 -0
  92. package/dist/types/src/functions/range.func.d.ts +3 -0
  93. package/dist/types/src/functions/speed/duration.func.d.ts +6 -0
  94. package/dist/types/src/functions/speed/mode.func.d.ts +7 -0
  95. package/dist/types/src/functions/time/full.func.d.ts +4 -0
  96. package/dist/types/src/functions/time/nowfull.func.d.ts +4 -0
  97. package/dist/types/src/functions/time/nowshort.func.d.ts +5 -0
  98. package/dist/types/src/functions/time/short.func.d.ts +7 -0
  99. package/dist/types/src/functions/timeline/create.funcs.d.ts +8 -0
  100. package/dist/types/src/functions/timeline/taps.func.d.ts +4 -0
  101. package/dist/types/src/functions/window/add.func.d.ts +7 -0
  102. package/dist/types/src/functions/window/get.func.d.ts +6 -0
  103. package/dist/types/src/index.d.ts +62 -0
  104. package/dist/types/src/plugins/dragon.bones/functions.d.ts +18 -0
  105. package/dist/types/src/plugins/dragon.bones/library.d.ts +875 -0
  106. package/dist/types/src/plugins/gsap/custom.ease.plugin.d.ts +2 -0
  107. package/dist/types/src/plugins/gsap/motion.path.plugin.d.ts +2 -0
  108. package/dist/types/src/plugins/modernizr/modernizr-custom.d.ts +1 -0
  109. package/dist/types/src/references.d.ts +4 -0
  110. package/dist/types/src/scenes/abstract.scene.d.ts +73 -0
  111. package/dist/types/src/scenes/background.scene.d.ts +35 -0
  112. package/dist/types/src/scenes/masked.scene.d.ts +15 -0
  113. package/dist/types/src/services/focus.services.d.ts +17 -0
  114. package/dist/types/src/services/iframe.service.d.ts +27 -0
  115. package/dist/types/src/services/langs.service.d.ts +31 -0
  116. package/dist/types/src/services/registry.service.d.ts +29 -0
  117. package/dist/types/src/services/settings.service.d.ts +51 -0
  118. package/dist/types/src/services/skip.service.d.ts +51 -0
  119. package/dist/types/src/services/sounds/sounds.service.d.ts +111 -0
  120. package/dist/types/src/services/storage.service.d.ts +38 -0
  121. package/dist/types/vite.config.d.ts +2 -0
  122. package/package.json +33 -0
@@ -0,0 +1,22 @@
1
+ import { TSlotConfig } from './slot.config';
2
+ /** Use only from components */
3
+ declare class SlotCheats {
4
+ [x: string]: any;
5
+ protected _config: TSlotConfig;
6
+ /** */
7
+ addGeneral(): void;
8
+ /** */
9
+ addSlot(): void;
10
+ /** */
11
+ addCascadeGeneral(): void;
12
+ /** */
13
+ addCascade(): void;
14
+ /** */
15
+ addIntrigue(): void;
16
+ /** */
17
+ addIntrigueSpineComponent(): void;
18
+ /** */
19
+ addCascadeBounce(): void;
20
+ }
21
+ export declare const slotCheats: SlotCheats;
22
+ export {};
@@ -0,0 +1,132 @@
1
+ import { Container } from '../../classes/container.class';
2
+ import { TGsapTimeline, TGsapTween, TNumberArray, TPixiPoint, TStringArray, TSupportContainer } from '../../extends/short.types';
3
+ import { TSymbolMoveBase, TSymbolsPayoutBase } from '../../extends/struct.types';
4
+ import { AbstractComponent } from '../abstract.component';
5
+ import { ICoefficientComponent } from './coefficient/coefficient.component';
6
+ import { IFramesComponent } from './frames/frames.component';
7
+ import { IHintsComponent } from './hints/hints.component';
8
+ import { IIntrigueComponent } from './intrigue/intrigue.component';
9
+ import { ILinesComponent } from './lines/lines.component';
10
+ import { IReelComponent } from './reel.component';
11
+ import { ISlotComponent, TLineDataLike, TSlotConfig, TSlotVector, TSoundEventOptions } from './slot.config';
12
+ import { ISymbolComponent } from './symbol/symbol.component';
13
+ /** Slot component */
14
+ export declare class FWSlotComponent extends AbstractComponent implements ISlotComponent {
15
+ protected _config: TSlotConfig;
16
+ protected _reels: IReelComponent[];
17
+ protected _layers: Map<string, Container>;
18
+ protected _framesComponent: IFramesComponent;
19
+ protected _coefficientComponent: ICoefficientComponent;
20
+ protected _linesComponent: ILinesComponent;
21
+ protected _intrigueComponent: IIntrigueComponent;
22
+ protected _hintsComponent: IHintsComponent;
23
+ protected _timelineLines: TGsapTimeline;
24
+ protected _breakableSleep: TGsapTween;
25
+ protected _playingSounds: TSoundEventOptions[];
26
+ protected _isMotion: boolean;
27
+ protected _startPromises: Promise<void>[];
28
+ /** Gets slot width */
29
+ get slotWidth(): number;
30
+ /** Gets slot height */
31
+ get slotHeight(): number;
32
+ /** Calc min stop time (ms) */
33
+ get minSpinTime(): number;
34
+ /** @constructor */
35
+ constructor(config?: TSlotConfig);
36
+ /** @inheritdoc */
37
+ create(instance?: TSupportContainer): Promise<this>;
38
+ /** @inheritdoc */
39
+ draw(): Promise<this>;
40
+ /** @inheritdoc */
41
+ destroy(): Promise<this>;
42
+ /** Creates reels components */
43
+ createReelsComponents(): Promise<void>;
44
+ /** Creates frames component */
45
+ createFramesComponent(): Promise<void>;
46
+ /** Creates coefficient component */
47
+ createCoefficientComponent(): Promise<void>;
48
+ /** Creates lines component */
49
+ createLinesComponent(): Promise<void>;
50
+ /** Creates intrigue component */
51
+ createIntrigueComponent(): Promise<void>;
52
+ /** Creates hints component */
53
+ createHintsComponent(): Promise<void>;
54
+ /** Starts spin */
55
+ start(): Promise<void>;
56
+ /** Stops spin */
57
+ stop(playground?: TNumberArray): Promise<void>;
58
+ /** Stops spin force */
59
+ stopForce(playground?: TNumberArray): Promise<void>;
60
+ /** */
61
+ refill(playground: TNumberArray, positionsIn?: TNumberArray, positionsMove?: TSymbolMoveBase[]): Promise<void>;
62
+ /** */
63
+ protected _animateMoveAndRefill(playground: TNumberArray, positionsIn: TNumberArray, positionsMove: TSymbolMoveBase[]): Promise<void>;
64
+ /** */
65
+ protected _animateMove(positions: TSymbolMoveBase[]): Promise<void>;
66
+ /** */
67
+ protected _animateRefill(playground: TNumberArray, positionsIn: TNumberArray): Promise<void>;
68
+ /** */
69
+ animateWin(payouts: TSymbolsPayoutBase[], coefficient: number): Promise<void>;
70
+ /** Find and play one sounds sample for whole line */
71
+ playSoundWin(positions: TNumberArray): void;
72
+ /** */
73
+ getIntrigueReels(playground: TNumberArray, positionsIn?: TNumberArray): TNumberArray;
74
+ /** Stop all started in the component sounds */
75
+ stopSounds(): void;
76
+ /** Starts animates lines */
77
+ startLines(lines: TLineDataLike[]): Promise<void>;
78
+ /** Stops lines */
79
+ stopLines(): void;
80
+ /** Animates symbols */
81
+ animateWinSymbols(positions: TNumberArray, coefficient?: number, frames?: boolean): Promise<void>;
82
+ /** */
83
+ animateHideSymbols(positions: TNumberArray): Promise<void>;
84
+ /** Animate symbols with custom animation */
85
+ animateSymbolsWith(positions: TNumberArray, animationName: string): Promise<void>;
86
+ /** Animates single line */
87
+ animateLine(lineData: TLineDataLike): Promise<void>;
88
+ /** Получить все позиции */
89
+ getAllPositions(): TNumberArray;
90
+ /** Получить коды символов */
91
+ getSymbols(): TNumberArray;
92
+ /** Получить компоненты символов */
93
+ getSymbolsComponents(): ISymbolComponent[];
94
+ /** Задать символы на поле */
95
+ setSymbols(symbols: TNumberArray): void;
96
+ /** Sets layers order */
97
+ setLayersOrder(order?: TStringArray): void;
98
+ /** enable / disable hints component */
99
+ toggleHints(on: boolean): void;
100
+ /** Gets unique positions of wins symbols */
101
+ getWinsPositions(lines: TSymbolsPayoutBase[]): TNumberArray;
102
+ /** Gets reel component */
103
+ getReel(iReel: number): IReelComponent;
104
+ /** Gets symbol component (two dimensional coords) */
105
+ getSymbolByVector(iReel: number, iRow: number): ISymbolComponent;
106
+ /** Gets symbol component (one dimensional coords) */
107
+ getSymbolByPosition(position: number): ISymbolComponent;
108
+ /** Gets reel position */
109
+ getReelPosition(iReel: number): number;
110
+ /** Gets row position */
111
+ getRowPosition(iRow: number): number;
112
+ /** Gets iReel by position (one dimensional coords) */
113
+ getReelByPosition(position: number): number;
114
+ /** Gets iRow by position (one dimensional coords) */
115
+ getRowByPosition(position: number): number;
116
+ /** Gets position by iReel, iRow */
117
+ getPositionByVector(iReel: number, iRow: number): number;
118
+ /** Gets iReel, iRow by position (one dimensional coords) */
119
+ getVectorByPosition(position: number): TSlotVector;
120
+ /** Gets point (x, y) by vector */
121
+ getPointByVector(iReel: number, iRow: number): TPixiPoint;
122
+ /** Gets point (x, y) by position */
123
+ getPointByPosition(position: number): TPixiPoint;
124
+ /** */
125
+ protected _getIReelsFromPositions(positions: TNumberArray): TNumberArray;
126
+ /** Sets default dynamic configs */
127
+ protected _setDefaultConfig(): void;
128
+ /** Sets textures */
129
+ protected _setTextures(): void;
130
+ /** add cheats to the cheat panel */
131
+ protected _runCheats(): void;
132
+ }
@@ -0,0 +1,82 @@
1
+ import { IComponent } from '../../extends/interfaces';
2
+ import { TNumberArray, TNumberArrays, TStringArray } from '../../extends/short.types';
3
+ import { TSymbolMoveBase, TSymbolsPayoutBase } from '../../extends/struct.types';
4
+ import { ICoefficientComponent, TConfigCoefficientComponent } from './coefficient/coefficient.component';
5
+ import { IFramesComponent, TConfigFramesComponent } from './frames/frames.component';
6
+ import { IHintsComponent, TConfigHintsComponent } from './hints/hints.component';
7
+ import { IIntrigueComponent, TConfigIntrigueComponent } from './intrigue/intrigue.component';
8
+ import { ILinesComponent, TConfigLinesComponent } from './lines/lines.component';
9
+ import { IReelComponent, TConfigReelComponent } from './reel.component';
10
+ import { ISymbolComponent, TConfigSymbolComponent } from './symbol/symbol.component';
11
+ export type ISlotComponent = {
12
+ start: () => Promise<void>;
13
+ stop: (playground?: TNumberArray, intrigueReels?: TNumberArray) => Promise<void>;
14
+ stopForce: (playground?: TNumberArray) => Promise<void>;
15
+ refill: (symbolCodes: TNumberArray, positionsIn?: TNumberArray, positionsMove?: TSymbolMoveBase[], intrigueReels?: TNumberArray) => Promise<void>;
16
+ animateWin: (payouts: TSymbolsPayoutBase[], coefficient: number) => Promise<void>;
17
+ animateHideSymbols: (positions: TNumberArray) => Promise<void>;
18
+ } & IComponent;
19
+ export type ISlotFactory = {
20
+ getReelComponent: (iReel: number, config: TConfigReelComponent) => IReelComponent;
21
+ getSymbolComponent: (iReel: number, iRow: number, config: TConfigSymbolComponent) => ISymbolComponent;
22
+ getFramesComponent?: (config: TConfigFramesComponent) => IFramesComponent;
23
+ getCoefficientComponent?: (config: TConfigCoefficientComponent) => ICoefficientComponent;
24
+ getLinesComponent?: (config: TConfigLinesComponent) => ILinesComponent;
25
+ getIntrigueComponent?: (config: TConfigIntrigueComponent) => IIntrigueComponent;
26
+ getHintsComponent?: (config: TConfigHintsComponent) => IHintsComponent;
27
+ };
28
+ export type TLineDataLike = {
29
+ line: TNumberArray;
30
+ coins: number;
31
+ length: number;
32
+ };
33
+ export type TSlotConfig = {
34
+ factory?: ISlotFactory;
35
+ numReels?: number;
36
+ order?: {
37
+ reels?: TNumberArray;
38
+ start?: TNumberArrays;
39
+ stop?: TNumberArrays;
40
+ layers?: TStringArray;
41
+ };
42
+ assetsName?: {
43
+ static?: string;
44
+ motion?: string;
45
+ };
46
+ texturesNames?: {
47
+ static?: [number, string][];
48
+ motion?: [number, string][];
49
+ };
50
+ slowStopReel?: number;
51
+ spinDelay?: {
52
+ start?: [number, number];
53
+ stop?: [number, number];
54
+ slowStop?: [number, number];
55
+ slowStopWin?: [number, number];
56
+ };
57
+ events?: {
58
+ start?: boolean;
59
+ stop?: boolean;
60
+ };
61
+ components?: {
62
+ reel: TConfigReelComponent;
63
+ frames?: TConfigFramesComponent;
64
+ coefficient?: TConfigCoefficientComponent;
65
+ lines?: TConfigLinesComponent;
66
+ intrigue?: TConfigIntrigueComponent;
67
+ hints?: TConfigHintsComponent;
68
+ };
69
+ sounds?: {
70
+ symbolsWin: Map<number, string>;
71
+ };
72
+ };
73
+ export type TSlotVector = {
74
+ iReel: number;
75
+ iRow: number;
76
+ };
77
+ export type TSoundEventOptions = {
78
+ name: string;
79
+ tag?: string;
80
+ delay?: number;
81
+ };
82
+ export declare const slotComponentConfig: TSlotConfig;
@@ -0,0 +1,84 @@
1
+ import { Sequence } from '../../../classes/sequence.class';
2
+ import { Spine } from '../../../classes/spine.assets.class';
3
+ import { IComponent } from '../../../extends/interfaces';
4
+ import { TCallbackAsync, TCallbackVoid, TPixiSprite, TPixiTexture, TSupportContainer } from '../../../extends/short.types';
5
+ import { AbstractComponent } from '../../abstract.component';
6
+ export type ISymbolComponent = {
7
+ iReel: number;
8
+ iRow: number;
9
+ code: number;
10
+ setTextureByCode: (code: number, isMotion?: boolean) => void;
11
+ animateName: TCallbackAsync;
12
+ animateWin: TCallbackAsync;
13
+ animateStop: TCallbackAsync;
14
+ animateIdle: TCallbackVoid;
15
+ animateShow: TCallbackAsync;
16
+ animateHide: TCallbackAsync;
17
+ destroyAnimation: TCallbackVoid;
18
+ } & IComponent;
19
+ export type TConfigSymbolComponent = {
20
+ size?: {
21
+ width?: number;
22
+ height?: number;
23
+ indentTop?: number;
24
+ indentLeft?: number;
25
+ motionScale?: number;
26
+ };
27
+ textures?: {
28
+ static?: Map<number, TPixiTexture>;
29
+ motion?: Map<number, TPixiTexture>;
30
+ };
31
+ animationAssets?: Map<number, string>;
32
+ animationNames?: {
33
+ win?: Map<number, string>;
34
+ idle?: Map<number, string>;
35
+ stop?: Map<number, string>;
36
+ };
37
+ fastModeTimeScale?: {
38
+ win?: number;
39
+ bounce?: number;
40
+ };
41
+ vanish?: {
42
+ enabled?: boolean;
43
+ assetName?: string;
44
+ animationName?: string;
45
+ hideDelay?: [number, number];
46
+ hideDuration?: [number, number];
47
+ timeScale?: [number, number];
48
+ };
49
+ };
50
+ /** Symbol component */
51
+ export declare abstract class FWAbstractSymbolComponent extends AbstractComponent implements ISymbolComponent {
52
+ iReel: number;
53
+ iRow: number;
54
+ code: number;
55
+ protected _config: TConfigSymbolComponent;
56
+ protected _sprite: TPixiSprite;
57
+ protected _animation: Sequence | Spine;
58
+ /** @constructor */
59
+ constructor(iReel: number, iRow: number, config: TConfigSymbolComponent);
60
+ /** @inheritdoc */
61
+ create(instance?: TSupportContainer): Promise<this>;
62
+ /** @inheritdoc */
63
+ draw(): Promise<this>;
64
+ /** @inheritdoc */
65
+ destroy(): Promise<this>;
66
+ /** Sets symbol's texture */
67
+ setTextureByCode(code: number, isMotion?: boolean): void;
68
+ /** Toggles cacheAsBitmap for animation */
69
+ toggleBitmap(on?: boolean): void;
70
+ /** */
71
+ animateHide(): Promise<void>;
72
+ /** */
73
+ animateShow(): Promise<void>;
74
+ /** Animate by name */
75
+ abstract animateName(name: string, timeScale: [number, number]): Promise<void>;
76
+ /** Animates stop */
77
+ abstract animateStop(): Promise<void>;
78
+ /** Animates win */
79
+ abstract animateWin(): Promise<void>;
80
+ /** Starts idle animation */
81
+ abstract animateIdle(): void;
82
+ /** Destroys animation */
83
+ abstract destroyAnimation(): void;
84
+ }
@@ -0,0 +1,18 @@
1
+ import { Sequence } from '../../../classes/sequence.class';
2
+ import { FWAbstractSymbolComponent } from './symbol.component';
3
+ /** Symbol component with sequence animations */
4
+ export declare class FWSymbolSequenceComponent extends FWAbstractSymbolComponent {
5
+ protected _animation: Sequence;
6
+ /** @inheritdoc */
7
+ animateName(): Promise<void>;
8
+ /** @inheritdoc */
9
+ animateWin(): Promise<void>;
10
+ /** @inheritdoc */
11
+ animateStop(): Promise<void>;
12
+ /** @inheritdoc */
13
+ animateIdle(): void;
14
+ /** @inheritdoc */
15
+ stopAnimation(): void;
16
+ /** @inheritdoc */
17
+ destroyAnimation(): void;
18
+ }
@@ -0,0 +1,18 @@
1
+ import { Spine } from '../../../classes/spine.assets.class';
2
+ import { FWAbstractSymbolComponent } from './symbol.component';
3
+ /** Symbol component */
4
+ export declare class FWSymbolSpineComponent extends FWAbstractSymbolComponent {
5
+ protected _animation: Spine;
6
+ /** Inits animation */
7
+ protected initAnimation(): boolean;
8
+ /** @inheritdoc */
9
+ animateName(name: string, timeScale: [number, number]): Promise<void>;
10
+ /** @inheritdoc */
11
+ animateWin(): Promise<void>;
12
+ /** @inheritdoc */
13
+ animateStop(): Promise<void>;
14
+ /** @inheritdoc */
15
+ animateIdle(): void;
16
+ /** @inheritdoc */
17
+ destroyAnimation(): void;
18
+ }
@@ -0,0 +1,62 @@
1
+ import { EPivot } from '../extends/enum.types';
2
+ import { TPixiSprite, TPixiTexture, TSupportContainer } from '../extends/short.types';
3
+ import { AbstractComponent } from './abstract.component';
4
+ import { TextComponent } from './text.component';
5
+ import * as PIXI from 'pixi.js';
6
+ export type TSwitchConfig = {
7
+ backgroundOnTexture: TPixiTexture;
8
+ backgroundOffTexture?: TPixiTexture;
9
+ checked: boolean;
10
+ handleOnTexture: TPixiTexture;
11
+ handleOffTexture?: TPixiTexture;
12
+ handlePositionOn?: {
13
+ x: number;
14
+ y: number;
15
+ };
16
+ handlePositionOff?: {
17
+ x: number;
18
+ y: number;
19
+ };
20
+ handleAnimationDuration?: number;
21
+ labelText?: string;
22
+ labelStyle?: PIXI.TextStyle;
23
+ labelPivot?: {
24
+ x: EPivot;
25
+ y: EPivot;
26
+ };
27
+ labelPosition?: {
28
+ x: number;
29
+ y: number;
30
+ };
31
+ initEvents?: boolean;
32
+ };
33
+ /** Компонент свитчера */
34
+ export declare class SwitchComponent extends AbstractComponent {
35
+ protected _config: TSwitchConfig;
36
+ protected _background: TPixiSprite;
37
+ protected _handle: TPixiSprite;
38
+ protected _label?: TextComponent;
39
+ protected _checked: boolean;
40
+ /** Состояние переключателя */
41
+ get checked(): boolean;
42
+ /** Переключить свитчер */
43
+ set checked(checked: boolean);
44
+ /** @constructor */
45
+ constructor(name: string, config: TSwitchConfig);
46
+ /** @inheritdoc */
47
+ create(instance?: TSupportContainer): Promise<this>;
48
+ /** @inheritdoc */
49
+ destroy(): Promise<this>;
50
+ /** @inheritdoc */
51
+ draw(): Promise<this>;
52
+ /** Задать текст для лейбла */
53
+ setLabelText(text: string): void;
54
+ /** */
55
+ setLabelMaxWidth(width: number): void;
56
+ /** Установить текстуры в зависимости от состояния */
57
+ protected _setTextures(): void;
58
+ /** Передвинуть свитчер в нужное положение */
59
+ protected _animateSwitch(duration?: number): Promise<void>;
60
+ /** Пользователь нажал на переключатель */
61
+ protected _onPointerDown(e?: PIXI.InteractionEvent): void;
62
+ }
@@ -0,0 +1,101 @@
1
+ import { TMixedObject, TPixiPoint, TSupportContainer } from '../extends/short.types';
2
+ import { AbstractComponent } from './abstract.component';
3
+ import * as PIXI from 'pixi.js';
4
+ export type TTextSizeOptions = {
5
+ width?: number;
6
+ height?: number;
7
+ isWordWrapMode?: boolean;
8
+ };
9
+ type TTextComponentOptions = {
10
+ upscale?: boolean;
11
+ };
12
+ /**
13
+ * Компонент текст
14
+ */
15
+ export declare class TextComponent extends AbstractComponent {
16
+ static defaultStyle: PIXI.TextStyle;
17
+ protected _text: string;
18
+ protected _style: TMixedObject | PIXI.TextStyle;
19
+ protected _styleUpscaleDefault: Record<string, string | number>;
20
+ protected _label: PIXI.Text;
21
+ protected _container: PIXI.Container;
22
+ protected _autopivot: {
23
+ xPos: number;
24
+ yPos: number;
25
+ };
26
+ protected _maxWidth: number;
27
+ protected _maxHeight: number;
28
+ protected _isWordWrapScaleMode: boolean;
29
+ protected _isUpscaleMode: boolean;
30
+ /**
31
+ * Установить текст и отрисовать с новым текстом
32
+ * @param text
33
+ */
34
+ set text(text: string);
35
+ /**
36
+ * Получить текущий текст
37
+ */
38
+ get text(): string;
39
+ /** Returns current scale of label */
40
+ get textScale(): TPixiPoint;
41
+ /**
42
+ * @constructor
43
+ * @param name
44
+ * @param text
45
+ * @param style
46
+ */
47
+ constructor(name: string, text: string, style?: TMixedObject | PIXI.TextStyle, options?: TTextComponentOptions);
48
+ /**
49
+ * Создать компонент
50
+ * @param instance
51
+ */
52
+ create(instance?: TSupportContainer): Promise<this>;
53
+ /**
54
+ * Уничтожить компонент
55
+ */
56
+ destroy(): Promise<this>;
57
+ /**
58
+ * Отрисовать компонент
59
+ */
60
+ draw(): Promise<this>;
61
+ /**
62
+ * Установить новое число.
63
+ * Работает как счетчик от текущего значения в текстовом поле до нового.
64
+ * @param value
65
+ * @param decimals
66
+ * @param after
67
+ */
68
+ setNumber(value: number, decimals: number, after?: string): Promise<this>;
69
+ /**
70
+ * Заменить/добавить часть стилей
71
+ * @param name
72
+ * @param value - значение конкретного стиля для подмены
73
+ */
74
+ setStyle(name: string, value: string | number): Promise<this>;
75
+ /**
76
+ * Полностью заменить все стили
77
+ * @param styles
78
+ */
79
+ setStyles(styles: PIXI.TextStyle): Promise<this>;
80
+ /**
81
+ * Установить пивот текста.
82
+ * Он сохранится и при каждом обновлении текста будет обновляться автоматически.
83
+ * @param xPos
84
+ * @param yPos
85
+ * @deprecated Use `textComponent.setAnchor(0, 0.5)`
86
+ */
87
+ setPivot(xPos: number, yPos: number): void;
88
+ /** Установить anchor текста */
89
+ setAnchor(x?: number, y?: number): this;
90
+ /**
91
+ * Установить ограничения для размера компонента
92
+ * Одновременная установка width и height возможна только при isWordWrapMode=true
93
+ * Чтобы работал перенос текста в стили к нему необходимо добавить wordWrap=true
94
+ */
95
+ setMaxSize(options?: TTextSizeOptions): void;
96
+ /** */
97
+ protected _upscaleProperties(): void;
98
+ /** */
99
+ protected _saveUpscaleStyles(style: TMixedObject | PIXI.TextStyle): void;
100
+ }
101
+ export {};
@@ -0,0 +1,55 @@
1
+ import { Container } from '../../classes/container.class';
2
+ import { TDeviceOrientationConfig, TPixiTextStyle, TSupportContainer } from '../../extends/short.types';
3
+ import { AbstractComponent } from '../abstract.component';
4
+ import { TextComponent } from '../text.component';
5
+ import { VolatilitySymbolComponent } from './volatility.symbol.component';
6
+ import * as PIXI from 'pixi.js';
7
+ export declare enum EConfigLabelPos {
8
+ top = "top",
9
+ bottom = "bottom",
10
+ right = "right",
11
+ left = "left"
12
+ }
13
+ export type TAdaptiveSettings = {
14
+ labelPaddingTop?: number;
15
+ labelPaddingLeft?: number;
16
+ labelPosition?: EConfigLabelPos;
17
+ labelMaxWidth?: number;
18
+ };
19
+ export type TVolatilityConfig = {
20
+ assetName?: string;
21
+ emptyTexture?: string;
22
+ fullTexture?: string;
23
+ textStyle?: TPixiTextStyle;
24
+ symbolsMargin?: number;
25
+ labelPaddingTop?: number;
26
+ labelPaddingLeft?: number;
27
+ labelPosition?: EConfigLabelPos;
28
+ labelMaxWidth?: number;
29
+ isMaskVertical?: boolean;
30
+ adaptive?: TDeviceOrientationConfig<TAdaptiveSettings>;
31
+ };
32
+ /** Component displays game volatility by icons */
33
+ export declare class VolatilityComponent extends AbstractComponent {
34
+ protected _text: string;
35
+ protected _volatility: number;
36
+ protected _maxVolatility: number;
37
+ protected _config: TVolatilityConfig;
38
+ protected _symbolsContainer: Container;
39
+ protected _labelComponent: TextComponent;
40
+ protected _symbols: VolatilitySymbolComponent[];
41
+ /** returns current adaptive settings */
42
+ get adaptive(): TAdaptiveSettings;
43
+ /** @constructor */
44
+ constructor(_text: string, _volatility: number, _maxVolatility: number, config?: TVolatilityConfig);
45
+ /** @inheritdoc */
46
+ create(instance: TSupportContainer): Promise<this>;
47
+ /** @inheritdoc */
48
+ destroy(): Promise<this>;
49
+ /** Calculate position of label by settings */
50
+ protected _getLabelPosition(): PIXI.Point;
51
+ /** @inheritdoc */
52
+ draw(modeChanged?: boolean): Promise<this>;
53
+ /** */
54
+ setLabelMaxWidth(width: number): void;
55
+ }
@@ -0,0 +1,20 @@
1
+ import { TPixiSprite, TSupportContainer } from '../../extends/short.types';
2
+ import { AbstractComponent } from '../abstract.component';
3
+ /** Creates Volatility symbol component */
4
+ export declare class VolatilitySymbolComponent extends AbstractComponent {
5
+ protected _assetName: string;
6
+ protected _empty: string;
7
+ protected _full: string;
8
+ protected _filling: number;
9
+ protected _isVertical: boolean;
10
+ protected _emptySprite: TPixiSprite;
11
+ protected _fullSprite: TPixiSprite;
12
+ /** @constructor */
13
+ constructor(_assetName: string, _empty: string, _full: string, _filling?: number, _isVertical?: boolean);
14
+ /** @inheritdoc */
15
+ create(instance: TSupportContainer): Promise<this>;
16
+ /** @inheritdoc */
17
+ destroy(): Promise<this>;
18
+ /** @inheritdoc */
19
+ draw(): Promise<this>;
20
+ }
@@ -0,0 +1,36 @@
1
+ export declare enum EEventPriority {
2
+ LOW = 0,
3
+ MEDIUM = 100,
4
+ HIGH = 200
5
+ }
6
+ export declare enum EPivot {
7
+ TOP = 0,
8
+ BOTTOM = 1,
9
+ CENTER = 2,
10
+ LEFT = 3,
11
+ RIGHT = 4
12
+ }
13
+ export declare enum EAssetType {
14
+ bitmapfont = 0,
15
+ dragonbones = 1,
16
+ sound = 2,
17
+ spritesheet = 3,
18
+ texture = 4,
19
+ webfont = 5,
20
+ spine = 6
21
+ }
22
+ export declare enum EPromoType {
23
+ freerounds = "freerounds"
24
+ }
25
+ /**
26
+ * Заготовки функций плавности
27
+ */
28
+ export declare enum ease {
29
+ none = "none",
30
+ in = "power2.in",
31
+ out = "power2.out",
32
+ inOut = "power2.inOut",
33
+ backOut = "back.out(1.4)",
34
+ bounceOut = "bounce.out",
35
+ elasticOut = "elastic.out(1, 0.4)"
36
+ }