@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.
- package/dist/truengine.es.js +35354 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/src/classes/assets.class.d.ts +89 -0
- package/dist/types/src/classes/bitmap.text.class.d.ts +77 -0
- package/dist/types/src/classes/borderview.class.d.ts +204 -0
- package/dist/types/src/classes/color.class.d.ts +72 -0
- package/dist/types/src/classes/container.class.d.ts +111 -0
- package/dist/types/src/classes/di.class.d.ts +110 -0
- package/dist/types/src/classes/emitter.class.d.ts +64 -0
- package/dist/types/src/classes/engine.class.d.ts +75 -0
- package/dist/types/src/classes/loaders.class.d.ts +28 -0
- package/dist/types/src/classes/preloader.class.d.ts +15 -0
- package/dist/types/src/classes/producer.class.d.ts +135 -0
- package/dist/types/src/classes/sequence.class.d.ts +30 -0
- package/dist/types/src/classes/skipable.class.d.ts +15 -0
- package/dist/types/src/classes/spine.assets.class.d.ts +42 -0
- package/dist/types/src/classes/tile.class.d.ts +38 -0
- package/dist/types/src/components/abstract.component.d.ts +52 -0
- package/dist/types/src/components/abstract.html.component.d.ts +43 -0
- package/dist/types/src/components/bigwin.component.d.ts +109 -0
- package/dist/types/src/components/blackout.component.d.ts +32 -0
- package/dist/types/src/components/button.component.d.ts +113 -0
- package/dist/types/src/components/button.faded.component.d.ts +29 -0
- package/dist/types/src/components/button.text.component.d.ts +49 -0
- package/dist/types/src/components/cheat.component.d.ts +63 -0
- package/dist/types/src/components/fillframe.component.d.ts +37 -0
- package/dist/types/src/components/fps.component.d.ts +39 -0
- package/dist/types/src/components/grid.component.d.ts +28 -0
- package/dist/types/src/components/link.component.d.ts +78 -0
- package/dist/types/src/components/particles.component.d.ts +30 -0
- package/dist/types/src/components/progress.component.d.ts +42 -0
- package/dist/types/src/components/slideshow/slides.reel.component.d.ts +65 -0
- package/dist/types/src/components/slideshow/slideshow.component.d.ts +27 -0
- package/dist/types/src/components/slideshow/slideshow.ui.component.d.ts +28 -0
- package/dist/types/src/components/slideshow/slideshow.ui.pagination.d.ts +30 -0
- package/dist/types/src/components/slot/coefficient/coefficient.component.d.ts +66 -0
- package/dist/types/src/components/slot/frames/frames.component.d.ts +39 -0
- package/dist/types/src/components/slot/frames/frames.sequence.component.d.ts +17 -0
- package/dist/types/src/components/slot/frames/frames.spine.component.d.ts +21 -0
- package/dist/types/src/components/slot/hints/hints.component.d.ts +102 -0
- package/dist/types/src/components/slot/intrigue/intrigue.component.d.ts +41 -0
- package/dist/types/src/components/slot/intrigue/intrigue.spine.component.d.ts +18 -0
- package/dist/types/src/components/slot/lines/lines.component.d.ts +29 -0
- package/dist/types/src/components/slot/lines/lines.static.component.d.ts +38 -0
- package/dist/types/src/components/slot/reel.component.d.ts +253 -0
- package/dist/types/src/components/slot/slot.cheats.d.ts +22 -0
- package/dist/types/src/components/slot/slot.component.d.ts +132 -0
- package/dist/types/src/components/slot/slot.config.d.ts +82 -0
- package/dist/types/src/components/slot/symbol/symbol.component.d.ts +84 -0
- package/dist/types/src/components/slot/symbol/symbol.sequence.component.d.ts +18 -0
- package/dist/types/src/components/slot/symbol/symbol.spine.component.d.ts +18 -0
- package/dist/types/src/components/switch.component.d.ts +62 -0
- package/dist/types/src/components/text.component.d.ts +101 -0
- package/dist/types/src/components/volatility/volatility.component.d.ts +55 -0
- package/dist/types/src/components/volatility/volatility.symbol.component.d.ts +20 -0
- package/dist/types/src/extends/enum.types.d.ts +36 -0
- package/dist/types/src/extends/interfaces.d.ts +74 -0
- package/dist/types/src/extends/javascript.d.ts +5 -0
- package/dist/types/src/extends/short.types.d.ts +68 -0
- package/dist/types/src/extends/struct.types.d.ts +260 -0
- package/dist/types/src/functions/agent.funcs.d.ts +84 -0
- package/dist/types/src/functions/animate/counter.func.d.ts +10 -0
- package/dist/types/src/functions/animate/fadein.func.d.ts +8 -0
- package/dist/types/src/functions/animate/fadeout.func.d.ts +8 -0
- package/dist/types/src/functions/animate/from.func.d.ts +10 -0
- package/dist/types/src/functions/animate/fromto.func.d.ts +11 -0
- package/dist/types/src/functions/animate/to.func.d.ts +10 -0
- package/dist/types/src/functions/array/indexofall.func.d.ts +2 -0
- package/dist/types/src/functions/array/position.func.d.ts +6 -0
- package/dist/types/src/functions/array/unique.func.d.ts +6 -0
- package/dist/types/src/functions/arraysintersect.func.d.ts +2 -0
- package/dist/types/src/functions/cache.funcs.d.ts +20 -0
- package/dist/types/src/functions/cheats.func.d.ts +2 -0
- package/dist/types/src/functions/convert/tofixed.func.d.ts +9 -0
- package/dist/types/src/functions/debug/container.func.d.ts +7 -0
- package/dist/types/src/functions/debug/line.func.d.ts +10 -0
- package/dist/types/src/functions/demotexture.func.d.ts +3 -0
- package/dist/types/src/functions/dom.funcs.d.ts +6 -0
- package/dist/types/src/functions/draw/canvasExtract.func.d.ts +16 -0
- package/dist/types/src/functions/draw/gradient.texture.func.d.ts +14 -0
- package/dist/types/src/functions/draw/radialGradient.func.d.ts +20 -0
- package/dist/types/src/functions/draw/rect.func.d.ts +12 -0
- package/dist/types/src/functions/draw/reel.func.d.ts +9 -0
- package/dist/types/src/functions/engine.funcs.d.ts +63 -0
- package/dist/types/src/functions/is.funcs.d.ts +16 -0
- package/dist/types/src/functions/math.funcs.d.ts +38 -0
- package/dist/types/src/functions/number/between.func.d.ts +7 -0
- package/dist/types/src/functions/object/deepMerge.d.ts +7 -0
- package/dist/types/src/functions/random/exclude.func.d.ts +6 -0
- package/dist/types/src/functions/random/inrange.func.d.ts +6 -0
- package/dist/types/src/functions/random/value.func.d.ts +10 -0
- package/dist/types/src/functions/range.func.d.ts +3 -0
- package/dist/types/src/functions/speed/duration.func.d.ts +6 -0
- package/dist/types/src/functions/speed/mode.func.d.ts +7 -0
- package/dist/types/src/functions/time/full.func.d.ts +4 -0
- package/dist/types/src/functions/time/nowfull.func.d.ts +4 -0
- package/dist/types/src/functions/time/nowshort.func.d.ts +5 -0
- package/dist/types/src/functions/time/short.func.d.ts +7 -0
- package/dist/types/src/functions/timeline/create.funcs.d.ts +8 -0
- package/dist/types/src/functions/timeline/taps.func.d.ts +4 -0
- package/dist/types/src/functions/window/add.func.d.ts +7 -0
- package/dist/types/src/functions/window/get.func.d.ts +6 -0
- package/dist/types/src/index.d.ts +62 -0
- package/dist/types/src/plugins/dragon.bones/functions.d.ts +18 -0
- package/dist/types/src/plugins/dragon.bones/library.d.ts +875 -0
- package/dist/types/src/plugins/gsap/custom.ease.plugin.d.ts +2 -0
- package/dist/types/src/plugins/gsap/motion.path.plugin.d.ts +2 -0
- package/dist/types/src/plugins/modernizr/modernizr-custom.d.ts +1 -0
- package/dist/types/src/references.d.ts +4 -0
- package/dist/types/src/scenes/abstract.scene.d.ts +73 -0
- package/dist/types/src/scenes/background.scene.d.ts +35 -0
- package/dist/types/src/scenes/masked.scene.d.ts +15 -0
- package/dist/types/src/services/focus.services.d.ts +17 -0
- package/dist/types/src/services/iframe.service.d.ts +27 -0
- package/dist/types/src/services/langs.service.d.ts +31 -0
- package/dist/types/src/services/registry.service.d.ts +29 -0
- package/dist/types/src/services/settings.service.d.ts +51 -0
- package/dist/types/src/services/skip.service.d.ts +51 -0
- package/dist/types/src/services/sounds/sounds.service.d.ts +111 -0
- package/dist/types/src/services/storage.service.d.ts +38 -0
- package/dist/types/vite.config.d.ts +2 -0
- package/package.json +33 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { TGsapTimeline, TSupportContainer } from '../extends/short.types';
|
|
2
|
+
import { AbstractComponent } from './abstract.component';
|
|
3
|
+
import * as PIXI from 'pixi.js';
|
|
4
|
+
/** */
|
|
5
|
+
export declare class BlackoutComponent extends AbstractComponent {
|
|
6
|
+
protected _background: PIXI.Sprite;
|
|
7
|
+
protected _inBackground: PIXI.Sprite;
|
|
8
|
+
protected _renderer: PIXI.Renderer | PIXI.AbstractRenderer;
|
|
9
|
+
protected _texture: PIXI.RenderTexture;
|
|
10
|
+
protected _textureColor: number;
|
|
11
|
+
protected _textureAlpha: number;
|
|
12
|
+
protected _crossfadeTl: TGsapTimeline;
|
|
13
|
+
/** */
|
|
14
|
+
constructor(name: string, renderer: PIXI.Renderer | PIXI.AbstractRenderer);
|
|
15
|
+
/**
|
|
16
|
+
* Создать компонент
|
|
17
|
+
* @param instance
|
|
18
|
+
*/
|
|
19
|
+
create(instance?: TSupportContainer): Promise<this>;
|
|
20
|
+
/** */
|
|
21
|
+
destroy(): Promise<this>;
|
|
22
|
+
/** Generate texture for blackout */
|
|
23
|
+
protected _generateTexture(color?: number, alpha?: number): PIXI.RenderTexture;
|
|
24
|
+
/** */
|
|
25
|
+
turnOn(color?: number, alpha?: number, duration?: number): Promise<void>;
|
|
26
|
+
/** Changes color if blackout is on */
|
|
27
|
+
turnTo(color?: number, alpha?: number, duration?: number): Promise<void>;
|
|
28
|
+
/** */
|
|
29
|
+
turnOff(duration?: number): Promise<void>;
|
|
30
|
+
/** */
|
|
31
|
+
draw(): Promise<this>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { TGenericObject, TPixiSprite, TPixiTexture, TSupportContainer } from '../extends/short.types';
|
|
2
|
+
import { AbstractComponent } from './abstract.component';
|
|
3
|
+
import * as PIXI from 'pixi.js';
|
|
4
|
+
/**
|
|
5
|
+
* Текстуры кнопки
|
|
6
|
+
*/
|
|
7
|
+
export declare class ButtonTextures {
|
|
8
|
+
origin: TPixiTexture;
|
|
9
|
+
hover: TPixiTexture;
|
|
10
|
+
click: TPixiTexture;
|
|
11
|
+
disable: TPixiTexture;
|
|
12
|
+
/**
|
|
13
|
+
* @constructor
|
|
14
|
+
*/
|
|
15
|
+
constructor(origin: TPixiTexture, hover: TPixiTexture, click: TPixiTexture, disable?: TPixiTexture);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Компонент кнопки.
|
|
19
|
+
* Имеет 4 текстуры в зависимости от состояния - оригинальная, ховер, клик, не активная.
|
|
20
|
+
* Также возможно переключение между двумя режимами (наподобии on/off).
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* # для расширения стандартной механики
|
|
24
|
+
* class RollButton extends ButtonComponent
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* this.rollButton = new ButtonComponent('roll', new ButtonTextures(
|
|
28
|
+
* btn.sprite.origin,
|
|
29
|
+
* btn.sprite.hover, ...)
|
|
30
|
+
* )
|
|
31
|
+
* this.rollButton.position.set(x,y)
|
|
32
|
+
* // in scene | producer | gameplay
|
|
33
|
+
* this.on('roll:click', async handler => await return)
|
|
34
|
+
*/
|
|
35
|
+
export declare class ButtonComponent extends AbstractComponent {
|
|
36
|
+
protected _textures: TGenericObject<ButtonTextures>;
|
|
37
|
+
protected _autoModes: boolean;
|
|
38
|
+
protected _modeOn: boolean;
|
|
39
|
+
protected _stateHovered: boolean;
|
|
40
|
+
protected _stateClicked: boolean;
|
|
41
|
+
protected _button: TPixiSprite;
|
|
42
|
+
debug: boolean;
|
|
43
|
+
emitHovers: boolean;
|
|
44
|
+
soundClick: string;
|
|
45
|
+
soundClickOff: string;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @constructor
|
|
49
|
+
* @param name
|
|
50
|
+
* @param modeOn
|
|
51
|
+
* @param modeOff
|
|
52
|
+
* @param autoModes
|
|
53
|
+
* @event 'click.[new.button]'
|
|
54
|
+
* @event 'hover.[new.button]'
|
|
55
|
+
*/
|
|
56
|
+
constructor(name: string, modeOn: ButtonTextures, modeOff?: ButtonTextures, autoModes?: boolean);
|
|
57
|
+
/**
|
|
58
|
+
* Создать компонент
|
|
59
|
+
* @param instance
|
|
60
|
+
*/
|
|
61
|
+
create(instance?: TSupportContainer): Promise<this>;
|
|
62
|
+
/**
|
|
63
|
+
* Уничтожить компонент
|
|
64
|
+
*/
|
|
65
|
+
destroy(): Promise<this>;
|
|
66
|
+
/** Отрисовать компонент */
|
|
67
|
+
draw(_modeChanged?: boolean): Promise<this>;
|
|
68
|
+
/**
|
|
69
|
+
* Установить текстуру на кнопку в зависимости от ее текущего состояния
|
|
70
|
+
*/
|
|
71
|
+
setTexture(): this;
|
|
72
|
+
/**
|
|
73
|
+
* Переключает режим (только если есть текстуры для второго режима)
|
|
74
|
+
* Сразу же меняет текстуру кнопки на актуальную
|
|
75
|
+
* @param on
|
|
76
|
+
*/
|
|
77
|
+
toggleMode(on?: boolean): this;
|
|
78
|
+
/**
|
|
79
|
+
* Имитировать клик на кнопку
|
|
80
|
+
*/
|
|
81
|
+
click(): this;
|
|
82
|
+
/** Заменяет текстуры кнопки */
|
|
83
|
+
changeTextures(modeOn: ButtonTextures, modeOff?: ButtonTextures): this;
|
|
84
|
+
/** */
|
|
85
|
+
protected _initEvents(): void;
|
|
86
|
+
/** */
|
|
87
|
+
protected _offEvents(): void;
|
|
88
|
+
/**
|
|
89
|
+
* Событие навёл курсор
|
|
90
|
+
* @param e
|
|
91
|
+
*/
|
|
92
|
+
protected _onPointerOver(e?: PIXI.InteractionEvent): void;
|
|
93
|
+
/**
|
|
94
|
+
* Событие нажал на кнопке
|
|
95
|
+
* @param e
|
|
96
|
+
*/
|
|
97
|
+
protected _onPointerDown(e?: PIXI.InteractionEvent): void;
|
|
98
|
+
/**
|
|
99
|
+
* Событие отпустил курсор на кнопке
|
|
100
|
+
* @param e
|
|
101
|
+
*/
|
|
102
|
+
protected _onPointerUp(): void;
|
|
103
|
+
/**
|
|
104
|
+
* Событие отвёл нажатый курсор
|
|
105
|
+
* @param e
|
|
106
|
+
*/
|
|
107
|
+
protected _onPointerUpOutSide(e?: PIXI.InteractionEvent): void;
|
|
108
|
+
/**
|
|
109
|
+
* Событие убрал курсор
|
|
110
|
+
* @param e
|
|
111
|
+
*/
|
|
112
|
+
protected _onPointerOut(e?: PIXI.InteractionEvent): void;
|
|
113
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TGsapTween, TPixiSprite, TSupportContainer } from '../extends/short.types';
|
|
2
|
+
import { ButtonComponent } from './button.component';
|
|
3
|
+
import * as PIXI from 'pixi.js';
|
|
4
|
+
/** Компонент анимированной кнопки */
|
|
5
|
+
export declare class ButtonFadedComponent extends ButtonComponent {
|
|
6
|
+
protected _faded: TPixiSprite;
|
|
7
|
+
protected _tweenFade: TGsapTween;
|
|
8
|
+
protected _stateFaded: boolean;
|
|
9
|
+
protected _eventType: string;
|
|
10
|
+
/** in seconds */
|
|
11
|
+
duration: number;
|
|
12
|
+
/** @inheritdoc */
|
|
13
|
+
create(instance?: TSupportContainer): Promise<this>;
|
|
14
|
+
/** @inheritdoc */
|
|
15
|
+
destroy(): Promise<this>;
|
|
16
|
+
/**
|
|
17
|
+
* Установить текстуру на кнопку в зависимости от ее текущего состояния
|
|
18
|
+
* @param duration длительность анимации в секундах
|
|
19
|
+
*/
|
|
20
|
+
setTexture(duration?: number): this;
|
|
21
|
+
/** */
|
|
22
|
+
animateFadeToggle(on: boolean, texture: PIXI.Texture, duration?: number): Promise<void>;
|
|
23
|
+
/** */
|
|
24
|
+
animateModeToggle(renderable: boolean, state: boolean, texture: PIXI.Texture): Promise<void>;
|
|
25
|
+
/** */
|
|
26
|
+
protected _initEvents(): void;
|
|
27
|
+
/** */
|
|
28
|
+
protected _offEvents(): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { TSupportContainer } from '../extends/short.types';
|
|
2
|
+
import { ButtonTextures } from './button.component';
|
|
3
|
+
import { ButtonFadedComponent } from './button.faded.component';
|
|
4
|
+
import { TextComponent } from './text.component';
|
|
5
|
+
import * as PIXI from 'pixi.js';
|
|
6
|
+
declare enum EButtonState {
|
|
7
|
+
origin = "origin",
|
|
8
|
+
hover = "hover",
|
|
9
|
+
click = "click",
|
|
10
|
+
disable = "disable"
|
|
11
|
+
}
|
|
12
|
+
type TChangeStyles = {
|
|
13
|
+
color: string;
|
|
14
|
+
shadowColor: string;
|
|
15
|
+
};
|
|
16
|
+
export type TButtonStateStyles = {
|
|
17
|
+
[EButtonState.origin]: TChangeStyles;
|
|
18
|
+
[EButtonState.hover]: TChangeStyles;
|
|
19
|
+
[EButtonState.click]: TChangeStyles;
|
|
20
|
+
[EButtonState.disable]: TChangeStyles;
|
|
21
|
+
};
|
|
22
|
+
type TButtonTextComponentOptions = {
|
|
23
|
+
upscale?: boolean;
|
|
24
|
+
};
|
|
25
|
+
/** Компонент анимированной кнопки с текстом */
|
|
26
|
+
export declare class ButtonTextComponent extends ButtonFadedComponent {
|
|
27
|
+
buttonText: TextComponent;
|
|
28
|
+
buttonTextStyle: PIXI.TextStyle;
|
|
29
|
+
buttonStyles: TButtonStateStyles;
|
|
30
|
+
autoScale: {
|
|
31
|
+
enabled: boolean;
|
|
32
|
+
scale: number;
|
|
33
|
+
};
|
|
34
|
+
protected _initialText: string;
|
|
35
|
+
protected _isUpscaleMode: boolean;
|
|
36
|
+
/** @inheritdoc */
|
|
37
|
+
constructor(name: string, text: string, modeOn: ButtonTextures, modeOff?: ButtonTextures, autoModes?: boolean, styles?: TButtonStateStyles, options?: TButtonTextComponentOptions);
|
|
38
|
+
/** @inheritdoc */
|
|
39
|
+
create(instance?: TSupportContainer): Promise<this>;
|
|
40
|
+
/** Получить состояние кнопки */
|
|
41
|
+
getButtonState(): EButtonState;
|
|
42
|
+
/** Установить текстуру на кнопку в зависимости от ее текущего состояния */
|
|
43
|
+
setTexture(): this;
|
|
44
|
+
/** */
|
|
45
|
+
draw(): Promise<this>;
|
|
46
|
+
/** @inheritdoc */
|
|
47
|
+
destroy(): Promise<this>;
|
|
48
|
+
}
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Controller, GUI } from 'lil-gui';
|
|
2
|
+
import { TGenericObject } from '../extends/short.types';
|
|
3
|
+
import { AbstractHtmlComponent } from './abstract.html.component';
|
|
4
|
+
export type TCheatSection = {
|
|
5
|
+
name: string;
|
|
6
|
+
value: string;
|
|
7
|
+
values?: string[];
|
|
8
|
+
};
|
|
9
|
+
export type TCheat = TGenericObject<TCheatSection>;
|
|
10
|
+
export type TCustomValue = number | string | boolean;
|
|
11
|
+
export type TCustomCheatParams = {
|
|
12
|
+
name: string;
|
|
13
|
+
value: TCustomValue;
|
|
14
|
+
group?: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Добавляет читинг тул
|
|
18
|
+
*/
|
|
19
|
+
export declare class CheatComponent extends AbstractHtmlComponent {
|
|
20
|
+
protected _cheat: TCheat;
|
|
21
|
+
protected _cheatOriginal: string;
|
|
22
|
+
protected _panel: GUI;
|
|
23
|
+
protected _cheatFolder: GUI;
|
|
24
|
+
protected _controllers: TGenericObject<Controller>;
|
|
25
|
+
customPresets: string[];
|
|
26
|
+
protected _custom: TGenericObject<TCustomValue>;
|
|
27
|
+
protected _customFolder: GUI;
|
|
28
|
+
protected _customGroupDelimiter: string;
|
|
29
|
+
protected _customGroups: Map<string, GUI>;
|
|
30
|
+
protected _customPresetNumber: Controller;
|
|
31
|
+
protected _customPresetValue: Controller;
|
|
32
|
+
protected _customPresetCopy: Controller;
|
|
33
|
+
protected _customPresetPaste: Controller;
|
|
34
|
+
protected _customControllers: Map<string, Controller>;
|
|
35
|
+
onChange: () => void;
|
|
36
|
+
/**
|
|
37
|
+
* Если нужно сделать тонкую настройку какого-то кастомного чита (step, min/max, выпадающий список и тд)
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* cheatComponent.customControllers.get('Slot_motion').min(10).max(150).step(1)
|
|
41
|
+
* cheatComponent.customControllers.get('Slot_intrigue.jingle').options(['intrigue.mp3', 'intrigue_final (03).mp3'])
|
|
42
|
+
*/
|
|
43
|
+
get customControllers(): Map<string, Controller>;
|
|
44
|
+
/** */
|
|
45
|
+
draw(): Promise<this>;
|
|
46
|
+
/** */
|
|
47
|
+
setCheat(cheat: TCheat): Promise<this>;
|
|
48
|
+
/** */
|
|
49
|
+
getCheat(): string;
|
|
50
|
+
/**
|
|
51
|
+
* добавить чит тайминга в панель
|
|
52
|
+
* функция вызывается через слушатель в любом компоненте
|
|
53
|
+
* добавить чит - this.emit('cheat.custom:add', { name, value, group })
|
|
54
|
+
* подписаться на изменение с панели - this.on('cheat.custom:changed', this.name, ({ name, value }) => value )
|
|
55
|
+
*/
|
|
56
|
+
setCustomCheat(name: string, value: TCustomValue, group?: string): void;
|
|
57
|
+
/** обновить сгенерированный строковый пресет в поле ввода */
|
|
58
|
+
protected _updatePreset(): void;
|
|
59
|
+
/** создать подпапку с читами таймингов */
|
|
60
|
+
protected _createCustomFolder(): void;
|
|
61
|
+
/** */
|
|
62
|
+
protected _updateCustomValues(preset: string): void;
|
|
63
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Sprite, Texture } from 'pixi.js';
|
|
2
|
+
import { TSupportContainer } from '../extends/short.types';
|
|
3
|
+
import { AbstractComponent } from './abstract.component';
|
|
4
|
+
export type TFillFrameConfig = {
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
color: string;
|
|
7
|
+
gradientLength?: number;
|
|
8
|
+
landscape?: {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
};
|
|
12
|
+
portrait?: {
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export declare class FillFrameComponent extends AbstractComponent {
|
|
18
|
+
protected config: TFillFrameConfig;
|
|
19
|
+
protected gradientTexture: Texture;
|
|
20
|
+
protected fillingTexture: Texture;
|
|
21
|
+
protected topFilling: Sprite;
|
|
22
|
+
protected bottomFilling: Sprite;
|
|
23
|
+
protected leftFilling: Sprite;
|
|
24
|
+
protected rightFilling: Sprite;
|
|
25
|
+
protected topGradient: Sprite;
|
|
26
|
+
protected bottomGradient: Sprite;
|
|
27
|
+
protected leftGradient: Sprite;
|
|
28
|
+
protected rightGradient: Sprite;
|
|
29
|
+
protected enabled: boolean;
|
|
30
|
+
constructor(config: TFillFrameConfig);
|
|
31
|
+
enable(): Promise<this>;
|
|
32
|
+
disable(): Promise<this>;
|
|
33
|
+
protected getGradientTexture(): Texture;
|
|
34
|
+
protected getFillingTexture(): Texture;
|
|
35
|
+
create(instance?: TSupportContainer): Promise<this>;
|
|
36
|
+
draw(): Promise<this>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { TInterval, TPixiTextStyle, TSupportContainer } from '../extends/short.types';
|
|
2
|
+
import { AbstractComponent } from './abstract.component';
|
|
3
|
+
import { TextComponent } from './text.component';
|
|
4
|
+
import * as PIXI from 'pixi.js';
|
|
5
|
+
type TConfig = {
|
|
6
|
+
textStyle: TPixiTextStyle;
|
|
7
|
+
updateIntervalMS: number;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
margin: number;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* On: emit('fps:show', { value: true })
|
|
14
|
+
* Off: emit('fps:show', { value: false })
|
|
15
|
+
* debug mode is required.
|
|
16
|
+
*/
|
|
17
|
+
export declare class FPSComponent extends AbstractComponent {
|
|
18
|
+
protected _config: TConfig;
|
|
19
|
+
protected _isDebug: boolean;
|
|
20
|
+
protected _updateInterval: TInterval;
|
|
21
|
+
protected _ticker: PIXI.Ticker;
|
|
22
|
+
protected _rect: PIXI.Graphics;
|
|
23
|
+
protected _text: TextComponent;
|
|
24
|
+
/** */
|
|
25
|
+
constructor(name?: string);
|
|
26
|
+
/** */
|
|
27
|
+
create(instance?: TSupportContainer): Promise<this>;
|
|
28
|
+
/** */
|
|
29
|
+
start(): void;
|
|
30
|
+
/** */
|
|
31
|
+
stop(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Уничтожить компонент
|
|
34
|
+
*/
|
|
35
|
+
destroy(): Promise<this>;
|
|
36
|
+
/** Отрисовать компонент */
|
|
37
|
+
draw(): Promise<this>;
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AbstractComponent } from './abstract.component';
|
|
2
|
+
import * as PIXI from 'pixi.js';
|
|
3
|
+
/**
|
|
4
|
+
* Рисует сетку поверх сцены.
|
|
5
|
+
* Компонент работает только в режиме setMode('grid')
|
|
6
|
+
*/
|
|
7
|
+
export declare class GridComponent extends AbstractComponent {
|
|
8
|
+
protected _sections: number;
|
|
9
|
+
protected _grid: PIXI.Graphics;
|
|
10
|
+
/**
|
|
11
|
+
* @constructor
|
|
12
|
+
* @param name
|
|
13
|
+
*/
|
|
14
|
+
constructor(name?: string);
|
|
15
|
+
/**
|
|
16
|
+
* Создать компонент
|
|
17
|
+
* @param instance
|
|
18
|
+
*/
|
|
19
|
+
create(): Promise<this>;
|
|
20
|
+
/**
|
|
21
|
+
* Уничтожить компонент
|
|
22
|
+
*/
|
|
23
|
+
destroy(): Promise<this>;
|
|
24
|
+
/**
|
|
25
|
+
* Рисует чернобелую сетку
|
|
26
|
+
*/
|
|
27
|
+
draw(): Promise<this>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { TSupportContainer } from '../extends/short.types';
|
|
2
|
+
import { AbstractComponent } from './abstract.component';
|
|
3
|
+
import { TextComponent } from './text.component';
|
|
4
|
+
import * as PIXI from 'pixi.js';
|
|
5
|
+
export declare enum ELinkState {
|
|
6
|
+
origin = "origin",
|
|
7
|
+
hover = "hover",
|
|
8
|
+
click = "click",
|
|
9
|
+
disable = "disable"
|
|
10
|
+
}
|
|
11
|
+
type TChangeStyles = {
|
|
12
|
+
color: string;
|
|
13
|
+
};
|
|
14
|
+
export type TLinkStateStyles = {
|
|
15
|
+
[ELinkState.origin]: TChangeStyles;
|
|
16
|
+
[ELinkState.hover]: TChangeStyles;
|
|
17
|
+
[ELinkState.click]: TChangeStyles;
|
|
18
|
+
[ELinkState.disable]: TChangeStyles;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Компонент кнопки "текст-ссылка"
|
|
22
|
+
*/
|
|
23
|
+
export declare class LinkComponent extends AbstractComponent {
|
|
24
|
+
protected _stateHovered: boolean;
|
|
25
|
+
protected _stateClicked: boolean;
|
|
26
|
+
protected _text: TextComponent;
|
|
27
|
+
protected _initialText: string;
|
|
28
|
+
textStyle: PIXI.TextStyle;
|
|
29
|
+
textStyles: TLinkStateStyles;
|
|
30
|
+
emitHovers: boolean;
|
|
31
|
+
soundClick: string;
|
|
32
|
+
/**
|
|
33
|
+
* @constructor
|
|
34
|
+
*/
|
|
35
|
+
constructor(name: string, text: string, styles?: TLinkStateStyles);
|
|
36
|
+
/**
|
|
37
|
+
* Создать компонент
|
|
38
|
+
* @param instance
|
|
39
|
+
*/
|
|
40
|
+
create(instance?: TSupportContainer): Promise<this>;
|
|
41
|
+
/** Уничтожить компонент */
|
|
42
|
+
destroy(): Promise<this>;
|
|
43
|
+
/** Отрисовать компонент */
|
|
44
|
+
draw(_modeChanged?: boolean): Promise<this>;
|
|
45
|
+
/** Получить состояние ссылки */
|
|
46
|
+
getButtonState(): ELinkState;
|
|
47
|
+
/** Установить стиль текста в зависимости от её текущего состояния */
|
|
48
|
+
setTextColor(): this;
|
|
49
|
+
/** Имитировать клик на ссылку */
|
|
50
|
+
click(): this;
|
|
51
|
+
/** */
|
|
52
|
+
protected _initEvents(): void;
|
|
53
|
+
/** */
|
|
54
|
+
protected _offEvents(): void;
|
|
55
|
+
/**
|
|
56
|
+
* Событие наведения курсора
|
|
57
|
+
* @param e
|
|
58
|
+
*/
|
|
59
|
+
protected _onPointerOver(e?: PIXI.InteractionEvent): void;
|
|
60
|
+
/**
|
|
61
|
+
* Событие нажатия на ссылке
|
|
62
|
+
* @param e
|
|
63
|
+
*/
|
|
64
|
+
protected _onPointerDown(e?: PIXI.InteractionEvent): void;
|
|
65
|
+
/** Событие отпустил курсор на ссылке */
|
|
66
|
+
protected _onPointerUp(): void;
|
|
67
|
+
/**
|
|
68
|
+
* Событие отвёл нажатый курсор
|
|
69
|
+
* @param e
|
|
70
|
+
*/
|
|
71
|
+
protected _onPointerUpOutSide(e?: PIXI.InteractionEvent): void;
|
|
72
|
+
/**
|
|
73
|
+
* Событие убрал курсор
|
|
74
|
+
* @param e
|
|
75
|
+
*/
|
|
76
|
+
protected _onPointerOut(e?: PIXI.InteractionEvent): void;
|
|
77
|
+
}
|
|
78
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Emitter, EmitterConfigV3 } from '@pixi/particle-emitter';
|
|
2
|
+
import { TGsapTimeline } from '../extends/short.types';
|
|
3
|
+
import { AbstractComponent } from './abstract.component';
|
|
4
|
+
/**
|
|
5
|
+
* #todo
|
|
6
|
+
* - pause/resume
|
|
7
|
+
* - stop() слишком резкий. Нужна возможность выключить плавно, чтобы частицы просто закончили свои анимации (задержка на lifetime.max)
|
|
8
|
+
*/
|
|
9
|
+
/** Implements base particles behavior */
|
|
10
|
+
export declare class ParticlesComponent extends AbstractComponent {
|
|
11
|
+
protected _emitter: Emitter;
|
|
12
|
+
protected _emitterConfig: EmitterConfigV3;
|
|
13
|
+
protected _elapsed: number;
|
|
14
|
+
protected _particlesTL: TGsapTimeline;
|
|
15
|
+
protected _fps: number;
|
|
16
|
+
/** returns current amount of particles */
|
|
17
|
+
get maxParticles(): number;
|
|
18
|
+
/** sets current amount of particle */
|
|
19
|
+
set maxParticles(value: number);
|
|
20
|
+
/** @inheritdoc */
|
|
21
|
+
draw(): Promise<this>;
|
|
22
|
+
/** @inheritdoc */
|
|
23
|
+
destroy(): Promise<this>;
|
|
24
|
+
/** Starts particles animation */
|
|
25
|
+
start(): void;
|
|
26
|
+
/** Stops particle animation */
|
|
27
|
+
stop(): void;
|
|
28
|
+
/** Updates ticker callback */
|
|
29
|
+
protected _updateParticles(): void;
|
|
30
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { TGsapTween, TPixiSprite, TSupportContainer } from '../extends/short.types';
|
|
2
|
+
import { AbstractComponent } from './abstract.component';
|
|
3
|
+
export type TConfigProgressComponent = {
|
|
4
|
+
assetName?: string;
|
|
5
|
+
total: number;
|
|
6
|
+
position: number;
|
|
7
|
+
filler: {
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
};
|
|
11
|
+
fillerOffset: {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
};
|
|
15
|
+
textures?: {
|
|
16
|
+
background: string;
|
|
17
|
+
filler: string;
|
|
18
|
+
mask: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Комопнент прогресс бар
|
|
23
|
+
*/
|
|
24
|
+
export declare class ProgressComponent extends AbstractComponent {
|
|
25
|
+
protected _config: TConfigProgressComponent;
|
|
26
|
+
protected _background: TPixiSprite;
|
|
27
|
+
protected _filler: TPixiSprite;
|
|
28
|
+
protected _mask: TPixiSprite;
|
|
29
|
+
protected _twin: TGsapTween;
|
|
30
|
+
/** */
|
|
31
|
+
get isMin(): boolean;
|
|
32
|
+
/** */
|
|
33
|
+
get isMax(): boolean;
|
|
34
|
+
/** */
|
|
35
|
+
constructor(name?: string, config?: TConfigProgressComponent);
|
|
36
|
+
/** */
|
|
37
|
+
create(instance?: TSupportContainer): Promise<this>;
|
|
38
|
+
/** */
|
|
39
|
+
setPosition(position: number): Promise<this>;
|
|
40
|
+
/** */
|
|
41
|
+
draw(): Promise<this>;
|
|
42
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Graphics, InteractionEvent } from 'pixi.js';
|
|
2
|
+
import { Container } from '../../classes/container.class';
|
|
3
|
+
import { IComponent } from '../../extends/interfaces';
|
|
4
|
+
import { TCallbackAsync, TDeviceOrientationConfig, TGsapTimeline, TNumberArray, TSupportContainer, TSupportMask } from '../../extends/short.types';
|
|
5
|
+
import { AbstractComponent } from '../abstract.component';
|
|
6
|
+
export type ISlideComponent = {
|
|
7
|
+
onMoveIn: TCallbackAsync;
|
|
8
|
+
onMoveOut: TCallbackAsync;
|
|
9
|
+
} & IComponent;
|
|
10
|
+
export type TConfigSlidesReel = {
|
|
11
|
+
slides: ISlideComponent[];
|
|
12
|
+
swipeLength: number;
|
|
13
|
+
adaptive: TDeviceOrientationConfig<{
|
|
14
|
+
slideWidth: number;
|
|
15
|
+
slideHeight: number;
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
18
|
+
/** Slides reel component. Contain slides, manages movement */
|
|
19
|
+
export declare class SlidesReelComponent extends AbstractComponent {
|
|
20
|
+
protected _config: TConfigSlidesReel;
|
|
21
|
+
protected _mask: TSupportMask;
|
|
22
|
+
protected _hitArea: Graphics;
|
|
23
|
+
protected _slides: Map<number, ISlideComponent>;
|
|
24
|
+
protected _slidesOrder: TNumberArray;
|
|
25
|
+
protected _reelContainer: Container;
|
|
26
|
+
protected _currentSlide: number;
|
|
27
|
+
protected _slideTl: TGsapTimeline;
|
|
28
|
+
protected _pressed: boolean;
|
|
29
|
+
protected _startPosition: number;
|
|
30
|
+
protected _startPressPosition: number;
|
|
31
|
+
protected _swipeLastPosition: number;
|
|
32
|
+
protected _swipeDirection: number;
|
|
33
|
+
/** Returns index of current slide */
|
|
34
|
+
get currentIndex(): number;
|
|
35
|
+
/** Check next slide availability */
|
|
36
|
+
get isNextAvailable(): boolean;
|
|
37
|
+
/** Check previous slide availability */
|
|
38
|
+
get isPrevAvailable(): boolean;
|
|
39
|
+
/** returns slide width */
|
|
40
|
+
get slideWidth(): number;
|
|
41
|
+
/** Returns slide height */
|
|
42
|
+
get slideHeight(): number;
|
|
43
|
+
/** @constructor */
|
|
44
|
+
constructor(config: TConfigSlidesReel);
|
|
45
|
+
/** @inheritdoc */
|
|
46
|
+
create(instance: TSupportContainer): Promise<this>;
|
|
47
|
+
/** @inheritdoc */
|
|
48
|
+
destroy(): Promise<this>;
|
|
49
|
+
/** @inheritdoc */
|
|
50
|
+
draw(isModeChanged?: boolean): Promise<this>;
|
|
51
|
+
/** Moves slides reel to show slide */
|
|
52
|
+
slideTo(slideId: number, animate?: boolean): Promise<void>;
|
|
53
|
+
/** Moves slides to the next position */
|
|
54
|
+
slideToNext(): Promise<void>;
|
|
55
|
+
/** Moves slides to the previous position */
|
|
56
|
+
slideToPrev(): Promise<void>;
|
|
57
|
+
/** Sets event listener */
|
|
58
|
+
protected _addEventListeners(): void;
|
|
59
|
+
/** */
|
|
60
|
+
protected _onPointerDown(e: InteractionEvent): void;
|
|
61
|
+
/** */
|
|
62
|
+
protected _onPointerMove(e: InteractionEvent): void;
|
|
63
|
+
/** */
|
|
64
|
+
protected _onPointerUp(e: InteractionEvent): void;
|
|
65
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { TSupportContainer } from '../../extends/short.types';
|
|
2
|
+
import { AbstractComponent } from '../abstract.component';
|
|
3
|
+
import { SlidesReelComponent, TConfigSlidesReel } from './slides.reel.component';
|
|
4
|
+
import { SlideshowUi, TConfigSlideshowUI } from './slideshow.ui.component';
|
|
5
|
+
export type TConfigSlideshow = {
|
|
6
|
+
reel: TConfigSlidesReel;
|
|
7
|
+
ui?: TConfigSlideshowUI;
|
|
8
|
+
};
|
|
9
|
+
/** Slideshow component */
|
|
10
|
+
export declare class SlideshowComponent extends AbstractComponent {
|
|
11
|
+
protected _reelComponent: SlidesReelComponent;
|
|
12
|
+
protected _ui: SlideshowUi;
|
|
13
|
+
protected _config: TConfigSlideshow;
|
|
14
|
+
/** Example */
|
|
15
|
+
/** @constructor */
|
|
16
|
+
constructor(name: string, config: TConfigSlideshow);
|
|
17
|
+
/** @inheritdoc */
|
|
18
|
+
create(instance: TSupportContainer): Promise<this>;
|
|
19
|
+
/** @inheritdoc */
|
|
20
|
+
destroy(): Promise<this>;
|
|
21
|
+
/** @inheritdoc */
|
|
22
|
+
draw(isModeChanged?: boolean): Promise<this>;
|
|
23
|
+
/** Update ui states */
|
|
24
|
+
protected _updateUiStates(): void;
|
|
25
|
+
/** Adds listeners */
|
|
26
|
+
protected _addEventListeners(): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Point } from 'pixi.js';
|
|
2
|
+
import { TDeviceOrientationConfig, TSupportContainer } from '../../extends/short.types';
|
|
3
|
+
import { AbstractComponent } from '../abstract.component';
|
|
4
|
+
import { ButtonTextures } from '../button.component';
|
|
5
|
+
import { ButtonFadedComponent } from '../button.faded.component';
|
|
6
|
+
import { SlideshowUiPagination, TConfigPagination } from './slideshow.ui.pagination';
|
|
7
|
+
export type TConfigSlideshowUI = {
|
|
8
|
+
pagination?: TConfigPagination;
|
|
9
|
+
arrowTextures?: ButtonTextures;
|
|
10
|
+
adaptive?: TDeviceOrientationConfig<Point>;
|
|
11
|
+
};
|
|
12
|
+
/** Slideshow ui. Control panel, buttons, pagination */
|
|
13
|
+
export declare class SlideshowUi extends AbstractComponent {
|
|
14
|
+
prevButton: ButtonFadedComponent;
|
|
15
|
+
nextButton: ButtonFadedComponent;
|
|
16
|
+
pagination: SlideshowUiPagination;
|
|
17
|
+
protected _hasArrows: boolean;
|
|
18
|
+
protected _hasPagination: boolean;
|
|
19
|
+
protected _config: TConfigSlideshowUI;
|
|
20
|
+
/** @constructor */
|
|
21
|
+
constructor(config: TConfigSlideshowUI);
|
|
22
|
+
/** @inheritdoc */
|
|
23
|
+
create(instance: TSupportContainer): Promise<this>;
|
|
24
|
+
/** @inheritdoc */
|
|
25
|
+
destroy(): Promise<this>;
|
|
26
|
+
/** @inheritdoc */
|
|
27
|
+
draw(modeChanged?: boolean): Promise<this>;
|
|
28
|
+
}
|