pixi-rainman-game-engine 0.2.2 → 0.2.4
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/ComponentRegistry/ComponentRegistry.d.ts +0 -17
- package/dist/ComponentRegistry/ComponentRegistry.js +0 -17
- package/dist/ComponentRegistry/types.d.ts +1 -1
- package/dist/Money/MoneyText.d.ts +0 -2
- package/dist/Money/MoneyText.js +0 -2
- package/dist/Rainman/Rainman.d.ts +0 -2
- package/dist/Rainman/Rainman.js +0 -2
- package/dist/Rainman/appConfig.d.ts +0 -1
- package/dist/Rainman/appConfig.js +1 -1
- package/dist/Rainman/types.d.ts +1 -0
- package/dist/application/ApiConfig/ApiConfig.d.ts +25 -43
- package/dist/application/ApiConfig/ApiConfig.js +25 -43
- package/dist/application/ApiConfig/SymbolId.d.ts +0 -5
- package/dist/application/ApiConfig/TransformationTypesId.d.ts +0 -4
- package/dist/application/ApiConfig/WinTypeId.d.ts +0 -4
- package/dist/application/ButtonsEventManager/ButtonsEventManager.d.ts +11 -32
- package/dist/application/ButtonsEventManager/ButtonsEventManager.js +11 -32
- package/dist/application/SoundManager/SoundManager.d.ts +8 -18
- package/dist/application/SoundManager/SoundManager.js +8 -18
- package/dist/application/SoundManager/types.d.ts +2 -4
- package/dist/application/SoundManager/types.js +1 -2
- package/dist/application/SpeedState/SpeedLevelHandler.d.ts +2 -8
- package/dist/application/SpeedState/SpeedLevelHandler.js +2 -8
- package/dist/application/SpinLogic/SpinLogic.d.ts +0 -2
- package/dist/application/SpinLogic/SpinLogic.js +0 -2
- package/dist/application/SpinLogic/SpinLogicDTO.d.ts +4 -9
- package/dist/application/SpinLogic/SpinLogicDTO.js +4 -9
- package/dist/application/SpinLogic/WinScenarios.d.ts +1 -1
- package/dist/application/SpinLogic/WinScenarios.js +1 -1
- package/dist/application/SpinLogic/util.d.ts +13 -18
- package/dist/application/SpinLogic/util.js +13 -20
- package/dist/components/AbstractFreeSpinContainer/AbstractFreeSpinContainer.d.ts +1 -3
- package/dist/components/AbstractFreeSpinContainer/AbstractFreeSpinContainer.js +1 -3
- package/dist/components/AbstractMainContainer/AbstractMainContainer.d.ts +19 -22
- package/dist/components/AbstractMainContainer/AbstractMainContainer.js +19 -22
- package/dist/components/GambleGame/GambleGame.d.ts +1 -3
- package/dist/components/GambleGame/GambleGame.js +1 -3
- package/dist/components/buttons/BaseButton/BaseButton.d.ts +1 -3
- package/dist/components/buttons/BaseButton/BaseButton.js +1 -3
- package/dist/components/buttons/BaseButton/ButtonState.d.ts +1 -1
- package/dist/components/buttons/BaseButton/ButtonState.js +1 -1
- package/dist/components/buttons/buttonGroups/LeftButtons.d.ts +1 -3
- package/dist/components/buttons/buttonGroups/LeftButtons.js +1 -3
- package/dist/components/buttons/buttonGroups/MiddleButtons.d.ts +0 -1
- package/dist/components/buttons/buttonGroups/MiddleButtons.js +0 -1
- package/dist/components/buttons/buttonGroups/RightButtons.d.ts +2 -3
- package/dist/components/buttons/buttonGroups/RightButtons.js +2 -3
- package/dist/components/buttons/buttonGroups/RightButtonsLandscape.d.ts +1 -1
- package/dist/components/buttons/buttonGroups/RightButtonsLandscape.js +1 -1
- package/dist/components/buttons/default/AutoplayButton.d.ts +2 -3
- package/dist/components/buttons/default/AutoplayButton.js +2 -3
- package/dist/components/buttons/default/BlackButton.d.ts +1 -2
- package/dist/components/buttons/default/BlackButton.js +1 -2
- package/dist/components/buttons/default/CollectButton.d.ts +2 -3
- package/dist/components/buttons/default/CollectButton.js +2 -3
- package/dist/components/buttons/default/InfoButton.d.ts +1 -1
- package/dist/components/buttons/default/InfoButton.js +1 -1
- package/dist/components/buttons/default/MoreButton.d.ts +1 -1
- package/dist/components/buttons/default/MoreButton.js +1 -1
- package/dist/components/buttons/default/NegButton.d.ts +1 -1
- package/dist/components/buttons/default/NegButton.js +1 -1
- package/dist/components/buttons/default/PlusButton.d.ts +1 -1
- package/dist/components/buttons/default/PlusButton.js +1 -1
- package/dist/components/buttons/default/RedButton.d.ts +1 -1
- package/dist/components/buttons/default/RedButton.js +1 -1
- package/dist/components/buttons/default/RefreshButton.d.ts +2 -1
- package/dist/components/buttons/default/RefreshButton.js +2 -1
- package/dist/components/buttons/default/SpeedControlButton.d.ts +1 -1
- package/dist/components/buttons/default/SpeedControlButton.js +1 -1
- package/dist/components/buttons/default/SpinConfirmationButton.d.ts +1 -0
- package/dist/components/buttons/default/SpinConfirmationButton.js +1 -0
- package/dist/components/buttons/default/VolumeButton.d.ts +1 -1
- package/dist/components/buttons/default/VolumeButton.js +1 -1
- package/dist/components/common/AnimatedBackground.d.ts +1 -5
- package/dist/components/common/AnimatedBackground.js +1 -5
- package/dist/components/common/Background.d.ts +3 -5
- package/dist/components/common/Background.js +3 -5
- package/dist/components/common/FreeSpinButton.d.ts +1 -3
- package/dist/components/common/FreeSpinButton.js +1 -3
- package/dist/components/common/Logo.d.ts +1 -3
- package/dist/components/common/Logo.js +1 -3
- package/dist/components/common/LogoStatic.d.ts +1 -3
- package/dist/components/common/LogoStatic.js +1 -3
- package/dist/components/common/ResumableContainers.d.ts +6 -6
- package/dist/components/common/ResumableContainers.js +6 -6
- package/dist/components/frame/AbstractColumnsContainer.d.ts +3 -9
- package/dist/components/frame/AbstractColumnsContainer.js +3 -9
- package/dist/components/frame/AbstractFrame.d.ts +6 -12
- package/dist/components/frame/AbstractFrame.js +6 -12
- package/dist/components/frame/AbstractInnerFrame.d.ts +1 -3
- package/dist/components/frame/AbstractInnerFrame.js +1 -3
- package/dist/components/frame/WinLineAnimation.d.ts +1 -3
- package/dist/components/frame/WinLineAnimation.js +1 -3
- package/dist/components/frame/constants.d.ts +7 -0
- package/dist/components/frame/constants.js +3 -0
- package/dist/components/frame/types.d.ts +4 -0
- package/dist/components/messageBox/MessageBox.d.ts +1 -3
- package/dist/components/messageBox/MessageBox.js +1 -3
- package/dist/components/symbols/AbstractSymbolBase.d.ts +1 -2
- package/dist/components/symbols/AbstractSymbolBase.js +1 -2
- package/dist/components/symbols/AbstractSymbolsColumn.d.ts +1 -3
- package/dist/components/symbols/AbstractSymbolsColumn.js +4 -5
- package/dist/components/symbols/DroppableSymbol.d.ts +0 -2
- package/dist/components/symbols/DroppableSymbol.js +0 -2
- package/dist/components/symbols/DroppableSymbolsColumn.d.ts +0 -2
- package/dist/components/symbols/DroppableSymbolsColumn.js +0 -2
- package/dist/components/symbols/types.d.ts +0 -1
- package/dist/components/symbols/types.js +0 -1
- package/dist/components/updatable/UpdatableTextComponent.d.ts +1 -3
- package/dist/components/updatable/UpdatableTextComponent.js +1 -3
- package/dist/components/updatable/UpdatableValueComponent.d.ts +1 -3
- package/dist/components/updatable/UpdatableValueComponent.js +1 -3
- package/dist/components/winLineIndicator/WinLineIndicator.d.ts +1 -3
- package/dist/components/winLineIndicator/WinLineIndicator.js +1 -3
- package/dist/connectivity/ConnectionWrapper.d.ts +1 -4
- package/dist/connectivity/ConnectionWrapper.js +1 -4
- package/dist/connectivity/LocalConnectionWrapper.d.ts +1 -1
- package/dist/connectivity/LocalConnectionWrapper.js +1 -1
- package/dist/connectivity/apiQueue.d.ts +2 -3
- package/dist/connectivity/apiQueue.js +2 -3
- package/dist/connectivity/wins.d.ts +0 -9
- package/dist/controllers/AbstractController.d.ts +27 -40
- package/dist/controllers/AbstractController.js +30 -41
- package/dist/controllers/QuickStopController.d.ts +1 -1
- package/dist/controllers/QuickStopController.js +1 -1
- package/dist/controllers/UiController.d.ts +2 -4
- package/dist/controllers/UiController.js +2 -4
- package/dist/loading/AbstractLoadingContainer.d.ts +1 -3
- package/dist/loading/AbstractLoadingContainer.js +1 -3
- package/dist/loading/ProgressiveLoader.d.ts +0 -2
- package/dist/loading/SpriteLoadingContainer.d.ts +1 -4
- package/dist/loading/SpriteLoadingContainer.js +1 -4
- package/dist/localStorage/localStorage.d.ts +0 -2
- package/dist/localStorage/localStorage.js +0 -2
- package/dist/stores/SettingsStore.d.ts +5 -10
- package/dist/stores/SettingsStore.js +5 -10
- package/dist/utils/assets/assetGetter.d.ts +10 -18
- package/dist/utils/assets/assetGetter.js +10 -18
- package/dist/utils/common/deviceOrientation.d.ts +1 -2
- package/dist/utils/common/deviceOrientation.js +1 -2
- package/dist/utils/common/functions.d.ts +7 -7
- package/dist/utils/common/functions.js +7 -7
- package/dist/utils/common/placementHelpers.d.ts +2 -3
- package/dist/utils/common/placementHelpers.js +4 -5
- package/dist/winComponents/AnimableParticlesEmitter.d.ts +1 -4
- package/dist/winComponents/AnimableParticlesEmitter.js +1 -4
- package/dist/winComponents/PositioningFrame.d.ts +1 -3
- package/dist/winComponents/PositioningFrame.js +1 -3
- package/dist/winComponents/UpdatableSpineContainer.d.ts +1 -3
- package/dist/winComponents/UpdatableSpineContainer.js +1 -3
- package/dist/winComponents/winFactory.d.ts +8 -9
- package/dist/winComponents/winFactory.js +8 -9
- package/package.json +3 -1
|
@@ -2,51 +2,43 @@ import { Texture } from "pixi.js";
|
|
|
2
2
|
import type { LoadersSpineData, Resource } from "./types";
|
|
3
3
|
/**
|
|
4
4
|
* Function for getting spine data for pixi-spines package
|
|
5
|
-
*
|
|
6
|
-
* @param {string} resourceName
|
|
5
|
+
* @param {string} resourceName - name of the spine from Assets object
|
|
7
6
|
* @throws {SpineDataNotFound}
|
|
8
|
-
* @returns {LoadersSpineData}
|
|
7
|
+
* @returns {LoadersSpineData} - spine data
|
|
9
8
|
*/
|
|
10
9
|
export declare const getSpineData: (resourceName: string) => LoadersSpineData;
|
|
11
10
|
/**
|
|
12
11
|
* Function for getting textures, created in `Assets.ts`
|
|
13
12
|
* This function throw error when texture is not present in cache
|
|
14
|
-
*
|
|
15
|
-
* @param {string} name
|
|
13
|
+
* @param {string} name - name of the texture
|
|
16
14
|
* @throws {TextureNotFoundError}
|
|
17
|
-
* @returns {Texture}
|
|
15
|
+
* @returns {Texture} - texture from cache
|
|
18
16
|
*/
|
|
19
17
|
export declare const getTexture: (name: string) => Texture<import("pixi.js").Resource>;
|
|
20
18
|
/**
|
|
21
19
|
* Function for getting textures from name
|
|
22
20
|
* If given asset does not exists in cache this function will return undefined
|
|
23
|
-
*
|
|
24
21
|
* @param {string} name - name of the texture
|
|
25
|
-
* @returns {Texture | undefined}
|
|
22
|
+
* @returns {Texture | undefined} - texture from cache or undefined
|
|
26
23
|
*/
|
|
27
24
|
export declare const getTextureSafely: (name: string) => Texture<import("pixi.js").Resource> | undefined;
|
|
28
25
|
/**
|
|
29
26
|
* Function for loading assets with Assets object from pixi
|
|
30
27
|
* To insert progress into separate loading container, please specify callback to update progress
|
|
31
|
-
*
|
|
32
|
-
* @
|
|
33
|
-
* @param {Resource} assets
|
|
34
|
-
* @param {(progress: number) => void | undefined} [updateProgress]
|
|
28
|
+
* @param {Resource} assets - game assets that should be loaded into game
|
|
29
|
+
* @param {(progress: number) => void | undefined} [updateProgress] - callback for updating progress
|
|
35
30
|
* @returns {Promise<void>}
|
|
36
31
|
*/
|
|
37
32
|
export declare const loadAssets: (assets: Resource, updateProgress?: ((progress: number) => void) | undefined) => Promise<void>;
|
|
38
33
|
/**
|
|
39
34
|
* Helper function for checking if given resources are present in pixi assets cache
|
|
40
|
-
*
|
|
41
|
-
* @
|
|
42
|
-
* @returns {boolean}
|
|
35
|
+
* @param {Resource} assets - game assets that should be loaded into game
|
|
36
|
+
* @returns {boolean} - true if all assets are present in cache
|
|
43
37
|
*/
|
|
44
38
|
export declare const checkIfAssetsLoaded: (assets: Resource) => boolean;
|
|
45
39
|
/**
|
|
46
40
|
* Function for checking if assets are loaded into the game
|
|
47
|
-
*
|
|
48
|
-
* @async
|
|
49
|
-
* @param {Resource} assets
|
|
41
|
+
* @param {Resource} assets - game assets that should be loaded into game
|
|
50
42
|
* @returns {Promise<void>}
|
|
51
43
|
*/
|
|
52
44
|
export declare const waitForAssetsToLoad: (assets: Resource) => Promise<void>;
|
|
@@ -3,10 +3,9 @@ import { SpineDataNotFound, TextureNotFoundError } from "../../errors";
|
|
|
3
3
|
import { logWarn } from "../common";
|
|
4
4
|
/**
|
|
5
5
|
* Function for getting spine data for pixi-spines package
|
|
6
|
-
*
|
|
7
|
-
* @param {string} resourceName
|
|
6
|
+
* @param {string} resourceName - name of the spine from Assets object
|
|
8
7
|
* @throws {SpineDataNotFound}
|
|
9
|
-
* @returns {LoadersSpineData}
|
|
8
|
+
* @returns {LoadersSpineData} - spine data
|
|
10
9
|
*/
|
|
11
10
|
export const getSpineData = (resourceName) => {
|
|
12
11
|
const spine = Assets.get(resourceName);
|
|
@@ -17,10 +16,9 @@ export const getSpineData = (resourceName) => {
|
|
|
17
16
|
/**
|
|
18
17
|
* Function for getting textures, created in `Assets.ts`
|
|
19
18
|
* This function throw error when texture is not present in cache
|
|
20
|
-
*
|
|
21
|
-
* @param {string} name
|
|
19
|
+
* @param {string} name - name of the texture
|
|
22
20
|
* @throws {TextureNotFoundError}
|
|
23
|
-
* @returns {Texture}
|
|
21
|
+
* @returns {Texture} - texture from cache
|
|
24
22
|
*/
|
|
25
23
|
export const getTexture = (name) => {
|
|
26
24
|
if (!Assets.cache.has(name))
|
|
@@ -30,9 +28,8 @@ export const getTexture = (name) => {
|
|
|
30
28
|
/**
|
|
31
29
|
* Function for getting textures from name
|
|
32
30
|
* If given asset does not exists in cache this function will return undefined
|
|
33
|
-
*
|
|
34
31
|
* @param {string} name - name of the texture
|
|
35
|
-
* @returns {Texture | undefined}
|
|
32
|
+
* @returns {Texture | undefined} - texture from cache or undefined
|
|
36
33
|
*/
|
|
37
34
|
export const getTextureSafely = (name) => {
|
|
38
35
|
if (!Assets.cache.has(name)) {
|
|
@@ -44,10 +41,8 @@ export const getTextureSafely = (name) => {
|
|
|
44
41
|
/**
|
|
45
42
|
* Function for loading assets with Assets object from pixi
|
|
46
43
|
* To insert progress into separate loading container, please specify callback to update progress
|
|
47
|
-
*
|
|
48
|
-
* @
|
|
49
|
-
* @param {Resource} assets
|
|
50
|
-
* @param {(progress: number) => void | undefined} [updateProgress]
|
|
44
|
+
* @param {Resource} assets - game assets that should be loaded into game
|
|
45
|
+
* @param {(progress: number) => void | undefined} [updateProgress] - callback for updating progress
|
|
51
46
|
* @returns {Promise<void>}
|
|
52
47
|
*/
|
|
53
48
|
export const loadAssets = async (assets, updateProgress) => {
|
|
@@ -56,9 +51,8 @@ export const loadAssets = async (assets, updateProgress) => {
|
|
|
56
51
|
};
|
|
57
52
|
/**
|
|
58
53
|
* Helper function for checking if given resources are present in pixi assets cache
|
|
59
|
-
*
|
|
60
|
-
* @
|
|
61
|
-
* @returns {boolean}
|
|
54
|
+
* @param {Resource} assets - game assets that should be loaded into game
|
|
55
|
+
* @returns {boolean} - true if all assets are present in cache
|
|
62
56
|
*/
|
|
63
57
|
export const checkIfAssetsLoaded = (assets) => {
|
|
64
58
|
for (const key of Object.keys(assets)) {
|
|
@@ -69,9 +63,7 @@ export const checkIfAssetsLoaded = (assets) => {
|
|
|
69
63
|
};
|
|
70
64
|
/**
|
|
71
65
|
* Function for checking if assets are loaded into the game
|
|
72
|
-
*
|
|
73
|
-
* @async
|
|
74
|
-
* @param {Resource} assets
|
|
66
|
+
* @param {Resource} assets - game assets that should be loaded into game
|
|
75
67
|
* @returns {Promise<void>}
|
|
76
68
|
*/
|
|
77
69
|
export const waitForAssetsToLoad = async (assets) => {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { getScreenRatio, isMobile } from "./screenHelpers";
|
|
2
2
|
/**
|
|
3
3
|
* Function for getting device orientation
|
|
4
|
-
*
|
|
5
|
-
* @returns {DeviceOrientation}
|
|
4
|
+
* @returns {DeviceOrientation} - device orientation
|
|
6
5
|
*/
|
|
7
6
|
export const getDeviceOrientation = () => {
|
|
8
7
|
if (isMobile()) {
|
|
@@ -3,8 +3,8 @@ import { Point } from "../../connectivity";
|
|
|
3
3
|
export declare const ceilToDecimal: (value: number, decimalPlaces?: number) => number;
|
|
4
4
|
/**
|
|
5
5
|
* Wait for a specified amount of time
|
|
6
|
-
*
|
|
7
|
-
* @
|
|
6
|
+
* @param {number} ms - time in milliseconds
|
|
7
|
+
* @returns {Promise<void>}
|
|
8
8
|
*/
|
|
9
9
|
export declare const wait: (ms: number) => Promise<void>;
|
|
10
10
|
export declare const range: (start: number, stop: number, step: number) => number[];
|
|
@@ -12,7 +12,7 @@ export declare const getRandomInt: (min: number, max: number) => number;
|
|
|
12
12
|
export declare const removeMatchingElements: <T>(array: T[], elementsToRemove: T[]) => T[];
|
|
13
13
|
export declare const hideLayerIfPresent: (elementsToSkip?: string[]) => boolean;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Hides paytable
|
|
16
16
|
*/
|
|
17
17
|
export declare const hidePaytable: () => void;
|
|
18
18
|
/**
|
|
@@ -21,10 +21,10 @@ export declare const hidePaytable: () => void;
|
|
|
21
21
|
export declare const togglePaytable: () => void;
|
|
22
22
|
/**
|
|
23
23
|
* Waits for spine animation to end
|
|
24
|
-
*
|
|
25
|
-
* @param
|
|
26
|
-
* @param
|
|
27
|
-
* @
|
|
24
|
+
* @param {Spine} spine - spine object
|
|
25
|
+
* @param {string} animationName - main animation that need to be played
|
|
26
|
+
* @param {string | undefined} loopAnimationName - loop animation that will be played after main animation
|
|
27
|
+
* @returns {Promise<void>}
|
|
28
28
|
*/
|
|
29
29
|
export declare const waitForAnimationToEnd: (spine: Spine, animationName: string, loopAnimationName?: string) => Promise<void>;
|
|
30
30
|
export declare const setTimeScale: (spine: Spine, flag: boolean) => void;
|
|
@@ -5,8 +5,8 @@ export const ceilToDecimal = (value, decimalPlaces = 2) => {
|
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
7
|
* Wait for a specified amount of time
|
|
8
|
-
*
|
|
9
|
-
* @
|
|
8
|
+
* @param {number} ms - time in milliseconds
|
|
9
|
+
* @returns {Promise<void>}
|
|
10
10
|
*/
|
|
11
11
|
export const wait = (ms) => {
|
|
12
12
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -39,7 +39,7 @@ export const hideLayerIfPresent = (elementsToSkip = []) => {
|
|
|
39
39
|
return anyHidden;
|
|
40
40
|
};
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
42
|
+
* Hides paytable
|
|
43
43
|
*/
|
|
44
44
|
export const hidePaytable = () => {
|
|
45
45
|
const paytableLayer = window.document.getElementById(UI_ITEMS.symbolPayTable);
|
|
@@ -58,10 +58,10 @@ export const togglePaytable = () => {
|
|
|
58
58
|
};
|
|
59
59
|
/**
|
|
60
60
|
* Waits for spine animation to end
|
|
61
|
-
*
|
|
62
|
-
* @param
|
|
63
|
-
* @param
|
|
64
|
-
* @
|
|
61
|
+
* @param {Spine} spine - spine object
|
|
62
|
+
* @param {string} animationName - main animation that need to be played
|
|
63
|
+
* @param {string | undefined} loopAnimationName - loop animation that will be played after main animation
|
|
64
|
+
* @returns {Promise<void>}
|
|
65
65
|
*/
|
|
66
66
|
export const waitForAnimationToEnd = async (spine, animationName, loopAnimationName) => {
|
|
67
67
|
spine.state.clearListeners();
|
|
@@ -3,9 +3,8 @@ import { Container, DisplayObject } from "pixi.js";
|
|
|
3
3
|
import { Nullable } from "./types";
|
|
4
4
|
export declare const scaleToParent: (width: number, height: number, parentWidth: number, parentHeight: number) => Rect;
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* @exports
|
|
6
|
+
* Get global min ratio of current device, used for scaling elements.
|
|
7
|
+
* @returns {number} - screen ration for current device
|
|
9
8
|
*/
|
|
10
9
|
export declare const globalMinRatio: () => number;
|
|
11
10
|
export declare const setChildIndexWithAscendingOrder: (parentContainer: Container, childrenComponents: Nullable<DisplayObject>[]) => void;
|
|
@@ -11,7 +11,7 @@ export const scaleToParent = (width, height, parentWidth, parentHeight) => {
|
|
|
11
11
|
policy: POLICY.ShowAll, // null | ExactFit | NoBorder | FullHeight | FullWidth | ShowAll
|
|
12
12
|
});
|
|
13
13
|
};
|
|
14
|
-
const
|
|
14
|
+
const getMobileScreenRatio = () => {
|
|
15
15
|
const globalXRatio = RainMan.app.screen.width / RainMan.config.gameWidth;
|
|
16
16
|
const globalYRatio = RainMan.app.screen.height / RainMan.config.gameHeight;
|
|
17
17
|
if (globalXRatio < globalYRatio) {
|
|
@@ -20,13 +20,12 @@ const valueForMobile = () => {
|
|
|
20
20
|
return globalYRatio * 2;
|
|
21
21
|
};
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* @exports
|
|
23
|
+
* Get global min ratio of current device, used for scaling elements.
|
|
24
|
+
* @returns {number} - screen ration for current device
|
|
26
25
|
*/
|
|
27
26
|
export const globalMinRatio = () => {
|
|
28
27
|
if (getScreenRatio() < 1) {
|
|
29
|
-
return
|
|
28
|
+
return getMobileScreenRatio();
|
|
30
29
|
}
|
|
31
30
|
const globalXRatio = RainMan.app.screen.width / RainMan.config.gameWidth;
|
|
32
31
|
const globalYRatio = RainMan.app.screen.height / RainMan.config.gameHeight;
|
|
@@ -2,11 +2,9 @@ import { EmitterConfigV3 } from "@pixi/particle-emitter";
|
|
|
2
2
|
import { Container } from "pixi.js";
|
|
3
3
|
/**
|
|
4
4
|
* Class for creating Emitter and plays particle animation background while Big, mystery wins
|
|
5
|
-
*
|
|
6
|
-
* @export
|
|
7
5
|
* @class AnimableParticlesEmitter
|
|
8
6
|
* @typedef {AnimableParticlesEmitter}
|
|
9
|
-
* @
|
|
7
|
+
* @augments {Container}
|
|
10
8
|
*/
|
|
11
9
|
export declare class AnimableParticlesEmitter extends Container {
|
|
12
10
|
private emitter;
|
|
@@ -14,7 +12,6 @@ export declare class AnimableParticlesEmitter extends Container {
|
|
|
14
12
|
constructor(particlesConfiguration: EmitterConfigV3);
|
|
15
13
|
/**
|
|
16
14
|
* Function for animating Emitter
|
|
17
|
-
*
|
|
18
15
|
* @public
|
|
19
16
|
*/
|
|
20
17
|
animate(): void;
|
|
@@ -2,11 +2,9 @@ import { Emitter } from "@pixi/particle-emitter";
|
|
|
2
2
|
import { Container } from "pixi.js";
|
|
3
3
|
/**
|
|
4
4
|
* Class for creating Emitter and plays particle animation background while Big, mystery wins
|
|
5
|
-
*
|
|
6
|
-
* @export
|
|
7
5
|
* @class AnimableParticlesEmitter
|
|
8
6
|
* @typedef {AnimableParticlesEmitter}
|
|
9
|
-
* @
|
|
7
|
+
* @augments {Container}
|
|
10
8
|
*/
|
|
11
9
|
export class AnimableParticlesEmitter extends Container {
|
|
12
10
|
emitter;
|
|
@@ -18,7 +16,6 @@ export class AnimableParticlesEmitter extends Container {
|
|
|
18
16
|
}
|
|
19
17
|
/**
|
|
20
18
|
* Function for animating Emitter
|
|
21
|
-
*
|
|
22
19
|
* @public
|
|
23
20
|
*/
|
|
24
21
|
animate() {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { ColorSource, Graphics } from "pixi.js";
|
|
2
2
|
/**
|
|
3
3
|
* Class for creating frame that can adjust position of elements
|
|
4
|
-
*
|
|
5
|
-
* @export
|
|
6
4
|
* @class PositioningFrame
|
|
7
5
|
* @typedef {PositioningFrame}
|
|
8
|
-
* @
|
|
6
|
+
* @augments {Graphics}
|
|
9
7
|
*/
|
|
10
8
|
export declare class PositioningFrame extends Graphics {
|
|
11
9
|
private backgroundColor;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { Graphics } from "pixi.js";
|
|
2
2
|
/**
|
|
3
3
|
* Class for creating frame that can adjust position of elements
|
|
4
|
-
*
|
|
5
|
-
* @export
|
|
6
4
|
* @class PositioningFrame
|
|
7
5
|
* @typedef {PositioningFrame}
|
|
8
|
-
* @
|
|
6
|
+
* @augments {Graphics}
|
|
9
7
|
*/
|
|
10
8
|
export class PositioningFrame extends Graphics {
|
|
11
9
|
backgroundColor;
|
|
@@ -5,11 +5,9 @@ import { PositioningFrame } from "./PositioningFrame";
|
|
|
5
5
|
/**
|
|
6
6
|
* Class for BigWin and Mystery win
|
|
7
7
|
* This class creates all of the texts and positions them
|
|
8
|
-
*
|
|
9
|
-
* @export
|
|
10
8
|
* @class UpdatableSpineContainer
|
|
11
9
|
* @typedef {UpdatableSpineContainer}
|
|
12
|
-
* @
|
|
10
|
+
* @augments {Container}
|
|
13
11
|
*/
|
|
14
12
|
export declare class UpdatableSpineContainer extends Container {
|
|
15
13
|
text: StylefulUpdatableText;
|
|
@@ -4,11 +4,9 @@ import { globalMinRatio } from "../utils";
|
|
|
4
4
|
/**
|
|
5
5
|
* Class for BigWin and Mystery win
|
|
6
6
|
* This class creates all of the texts and positions them
|
|
7
|
-
*
|
|
8
|
-
* @export
|
|
9
7
|
* @class UpdatableSpineContainer
|
|
10
8
|
* @typedef {UpdatableSpineContainer}
|
|
11
|
-
* @
|
|
9
|
+
* @augments {Container}
|
|
12
10
|
*/
|
|
13
11
|
export class UpdatableSpineContainer extends Container {
|
|
14
12
|
text;
|
|
@@ -3,14 +3,13 @@ import { AnimableParticlesEmitter } from "./AnimableParticlesEmitter";
|
|
|
3
3
|
import { UpdatableSpineContainer } from "./UpdatableSpineContainer";
|
|
4
4
|
/**
|
|
5
5
|
* Factory function for creating BigWin and Mystery win containers
|
|
6
|
-
*
|
|
7
|
-
* @param {string}
|
|
8
|
-
* @param {string}
|
|
9
|
-
* @param {string}
|
|
10
|
-
* @param {
|
|
11
|
-
* @param {
|
|
12
|
-
* @param {
|
|
13
|
-
* @
|
|
14
|
-
* @returns
|
|
6
|
+
* @param {string} textRegistryName - name of text in game registry
|
|
7
|
+
* @param {string} defaultText - default text
|
|
8
|
+
* @param {string} spineName - name of spine animation
|
|
9
|
+
* @param {string} animationName - name of animation
|
|
10
|
+
* @param {AnimableParticlesEmitter[]} emitters - array of emitters
|
|
11
|
+
* @param {Partial<ITextStyle>} textStyleOverrides - overrides for text style
|
|
12
|
+
* @param {number | undefined} spineScale - scale of spine animation
|
|
13
|
+
* @returns {UpdatableSpineContainer} - container with scalable spine, text and emitters
|
|
15
14
|
*/
|
|
16
15
|
export declare const winFactory: (textRegistryName: string, defaultText: string, spineName: string, animationName: string, emitters?: AnimableParticlesEmitter[], textStyleOverrides?: Partial<ITextStyle>, spineScale?: number) => UpdatableSpineContainer;
|
|
@@ -4,15 +4,14 @@ import { PositioningFrame } from "./PositioningFrame";
|
|
|
4
4
|
import { UpdatableSpineContainer } from "./UpdatableSpineContainer";
|
|
5
5
|
/**
|
|
6
6
|
* Factory function for creating BigWin and Mystery win containers
|
|
7
|
-
*
|
|
8
|
-
* @param {string}
|
|
9
|
-
* @param {string}
|
|
10
|
-
* @param {string}
|
|
11
|
-
* @param {
|
|
12
|
-
* @param {
|
|
13
|
-
* @param {
|
|
14
|
-
* @
|
|
15
|
-
* @returns
|
|
7
|
+
* @param {string} textRegistryName - name of text in game registry
|
|
8
|
+
* @param {string} defaultText - default text
|
|
9
|
+
* @param {string} spineName - name of spine animation
|
|
10
|
+
* @param {string} animationName - name of animation
|
|
11
|
+
* @param {AnimableParticlesEmitter[]} emitters - array of emitters
|
|
12
|
+
* @param {Partial<ITextStyle>} textStyleOverrides - overrides for text style
|
|
13
|
+
* @param {number | undefined} spineScale - scale of spine animation
|
|
14
|
+
* @returns {UpdatableSpineContainer} - container with scalable spine, text and emitters
|
|
16
15
|
*/
|
|
17
16
|
export const winFactory = (textRegistryName, defaultText, spineName, animationName, emitters = [], textStyleOverrides = {}, spineScale) => {
|
|
18
17
|
const textStyle = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pixi-rainman-game-engine",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "This repository contains all of the mechanics that used in rainman games.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -46,11 +46,13 @@
|
|
|
46
46
|
"@types/react-custom-scroll": "^5.0.3",
|
|
47
47
|
"@types/react-dom": "^18.2.22",
|
|
48
48
|
"@types/stats.js": "^0.17.3",
|
|
49
|
+
"@types/web": "^0.0.199",
|
|
49
50
|
"@typescript-eslint/eslint-plugin": "^7.0.2",
|
|
50
51
|
"@typescript-eslint/parser": "^7.0.2",
|
|
51
52
|
"copyfiles": "^2.4.1",
|
|
52
53
|
"eslint": "^8.57.0",
|
|
53
54
|
"eslint-config-prettier": "^9.1.0",
|
|
55
|
+
"eslint-plugin-jsdoc": "^50.6.3",
|
|
54
56
|
"eslint-plugin-simple-import-sort": "^12.0.0",
|
|
55
57
|
"eslint-plugin-sort-class-members": "^1.20.0",
|
|
56
58
|
"eslint-prettier-config": "^1.0.1",
|