Merge branch 'develop' into feature/add-setup-ui-panel-main-game

This commit is contained in:
dungdq 2025-05-08 17:54:32 +07:00
commit cd15562317
19 changed files with 37 additions and 57 deletions

View File

@ -41,15 +41,20 @@ Try to run the project, you'll the result as below. It doesn't look like much bu
## Setup Reel Slot ## Setup Reel Slot
--- ---
1. Prepare the asset for symbols. 1. Prepare the asset for symbols and reel frame.
![Add Symbol Texture](./img/05-main-scene/add-symbol-texture.png) ![Add Symbol Texture](./img/05-main-scene/add-symbol-texture.png)
![Add Symbol Texture](./img/05-main-scene/add-reel-frame.png)
2. Add symbols to **SpriteFrameProvider** which allows those symbols to be accessed globally from the code. 2. Add symbols to **SpriteFrameProvider** which allows those symbols to be accessed globally from the code.
![Sprite Frame Provider](./img/05-main-scene/sprite-frame-provider.png) ![Sprite Frame Provider](./img/05-main-scene/sprite-frame-provider.png)
3. Config reel slot using `reel-scroller-helper`. 3. Add reel frame.
![Sprite Frame Provider](./img/05-main-scene/add-reel-frame-2.png) ![Sprite Frame Provider](./img/05-main-scene/reel-frame.png)
4. Config reel slot using `reel-scroller-helper`.
![Reel Scroller Helper](./img/05-main-scene/reel-scroller-helper.png) ![Reel Scroller Helper](./img/05-main-scene/reel-scroller-helper.png)
@ -63,7 +68,7 @@ Try to run the project, you'll the result as below. It doesn't look like much bu
|**Cell Dim Color**| set the dark color for the non-win cells when showing winning animation for each line.|![dim-cell-color](./img/05-main-scene/dim-cell-color.png)| |**Cell Dim Color**| set the dark color for the non-win cells when showing winning animation for each line.|![dim-cell-color](./img/05-main-scene/dim-cell-color.png)|
|**Top Count and Bot Count**| for spinning logic to work, a certain number of cell will be added to the top and bottom of the reel.|![cell-top-bottom](./img/05-main-scene/cell-top-bottom.png)| |**Top Count and Bot Count**| for spinning logic to work, a certain number of cell will be added to the top and bottom of the reel.|![cell-top-bottom](./img/05-main-scene/cell-top-bottom.png)|
4. Generate panel using `reel-scroller-helper`. 5. Generate panel using `reel-scroller-helper`.
![Generate Panel](./img/05-main-scene/generate-panel.png) ![Generate Panel](./img/05-main-scene/generate-panel.png)
@ -83,21 +88,11 @@ The setup is very straightforward by using the `Generate Panel` command in each
![Landing Panel](./img/05-main-scene/landing-panel.png) ![Landing Panel](./img/05-main-scene/landing-panel.png)
To define Landing Panel, create the following script:
:::warning
```jsx title="assets/game-assets/scripts/slotty-settings/extend-slotty-setting.js"
SlottySetting.prototype._registerInjection = function () {
DIContainer.Register('landingGenerator', require('landing-generator'));
};
```
:::
- Present Win Cell Panel: - Present Win Cell Panel:
![Present Win Cell Panel](./img/05-main-scene/present-win-cell-panel.png) ![Present Win Cell Panel](./img/05-main-scene/present-win-cell-panel.png)
- Present Win Border Panel: - Present Win Cell Panel:
![Present Win Border Panel](./img/05-main-scene/present-win-border-panel.png) ![Present Win Border Panel](./img/05-main-scene/present-win-border-panel.png)
@ -108,17 +103,6 @@ To define Landing Panel, create the following script:
If the tension use a custom size frame, we can change the option **sizeMode** to **Custom** and set the static frame and size. If the tension use a custom size frame, we can change the option **sizeMode** to **Custom** and set the static frame and size.
![Tension Size Custom](./img/05-main-scene/tension-panel-custom.png) ![Tension Size Custom](./img/05-main-scene/tension-panel-custom.png)
**check toggle General Panel**
![Tension Size Custom](./img/05-main-scene/note-bug-tension.png)
To define Tension Panel, create the following script:
:::warning
```jsx title="assets/game-assets/scripts/slotty-settings/extend-slotty-setting.js"
SlottySetting.prototype._registerInjection = function () {
DIContainer.Register('tensionGenerator', require('tension-generator'));
};
```
:::
## Setup UI Panel ## Setup UI Panel
@ -211,7 +195,7 @@ The `FormatText` property controls text formatting behavior for label components
#### Step 3: Setup UI In Main Scenes #### Step 3: Setup UI In Main Scenes
Create new node and configuration in your main scene: Create new node and configuration in your main scene:
![main scenes](./img/05-main-scene/set-positon-bottom-bar.png) ![main scenes](./img/05-main-scene/prepare-ui-bottom-bar.png)
##### Platform Node Spawner Settings ##### Platform Node Spawner Settings
@ -351,52 +335,45 @@ Background overview:
**Background portrait** only use for Mobile portrait. **Background portrait** only use for Mobile portrait.
### 1. Prepare the assets ### Prepare the assets
| | Assets | Description | | | Assets | Description |
|:-:|--------------|---------| |:-:|--------------|---------|
|**Static**<br/>|![Background Prepare Landscape](./img/05-main-scene/bg-prepare-assets-static.png)|Static background is necessary for the game| |**Static**<br/>|![Background Prepare Landscape](./img/05-main-scene/bg-prepare-assets-static.png)|Static background is necessary for the game|
|**Animation**<br/>|![Background Prepare Portrait](./img/05-main-scene/bg-prepare-assets-anim.png)|Animation background may or may not be present, depending on the game design| |**Animation**<br/>|![Background Prepare Portrait](./img/05-main-scene/bg-prepare-assets-anim.png)|Animation background may or may not be present, depending on the game design|
### 2. Background Landscape ### Background Landscape
- **background-container:** must have **orientation-ui-controller** to display on Landscape with the options below. We use sprite frame background for landscape from prepared assets.
- **background-main-game:** we use sprite frame from prepared assets.
Both must add component **Widget** with the options below to resize with parent node.
![Background Setup Landscape](./img/05-main-scene/bg-setup-landscape.png) ![Background Setup Landscape](./img/05-main-scene/bg-setup-landscape.png)
### 3. Background Portrait ### Background Portrait
- **moible-background-container:** We use sprite frame background for mobile from prepared assets.
- Add **mobile-portrait-background-ui-controller** to display only on Mobile.
- Add **background-mobile-portrait-fullscreen-scaler** to resize with screen resolution.
- Add **orientation-ui-controller** to display on Portrait with the options below.
- **mobile-background-main-game:** we use sprite frame from prepared assets. Must add component **Widget** with the options below to resize with parent node.
![Background Setup Portrait](./img/05-main-scene/bg-setup-portrait.png) ![Background Setup Portrait](./img/05-main-scene/bg-setup-portrait.png)
### 4. Background Animation ### Background Animation
If the game have design animation for background, we will do this step. If the game have design animation for background, we will do this step.
1. Add **animation-provider**: This component contains all **animation** of the game. 1. Using hepler to generate animation from prepared assets
2. Using hepler to generate animation.
![Background Setup Helper Anim](./img/05-main-scene/bg-setup-hepler-anim.png) ![Background Setup Helper Anim](./img/05-main-scene/bg-setup-hepler-anim.png)
![Background Setup Helper Anim](./img/05-main-scene/bg-setup-anim-provider.png)
3. We have the result as below, and continue setup for **spine-animation**. 2. We have the result as below, and continue setup for **spine-animation**.
- **Is Loop**: is ✅ because this animation will play through the game. - **Is Loop**: is ✅ because this animation will play through the game.
- **Static Sprite Frame**: It will be displayed when the animation has not finished loading. - **Static Sprite Frame**: It will be displayed when the animation has not finished loading.
![Background Setup Animation](./img/05-main-scene/bg-setup-animation.png) ![Background Setup Animation](./img/05-main-scene/bg-setup-anim-1.png)
![Background Setup Animation](./img/05-main-scene/bg-setup-anim-2.png)
4. Add animation background with component below: 3. Add animation background with component below:
**Animation background landscape** **Animation background landscape**
- Create **Empty Node** with name **anim-background-main-game**.
- Add **animation-play-on-anable** with animation name in **Animation Provider**. - Add **animation-play-on-anable** with animation name in **Animation Provider**.
- Add **background-scaler** resize with screen resolution. - Add **background-scaler** resize with screen resolution.
@ -404,20 +381,23 @@ If the game have design animation for background, we will do this step.
**Animation background portrait** **Animation background portrait**
- **mobile-background-anim-portrait:** - Create **Empty Node** with name **mobile-background-anim-portrait**.
- Add **mobile-portrait-background-ui-controller** to display only on **Mobile**. - Add **mobile-portrait-background-ui-controller** to display only on **Mobile**.
- Add **orientation-ui-controller** to display on Portrait with the options below. - Add **orientation-ui-controller** to display on Portrait with the options below.
- **anim-background-main-game:**
- **animation-play-on-anable** with animation name in **Animation Provider**.
- **portrait-anim-background-scaler** resize with screen resolution.
![Background Setup Anim Portrait](./img/05-main-scene/bg-setup-anim-portrait.png) ![Background Setup Anim Portrait](./img/05-main-scene/bg-setup-anim-portrait-1.png)
- Create **Empty Node** with name **anim-background-main-game**.
- Add **animation-play-on-anable** with animation name in **Animation Provider**.
- Add **portrait-anim-background-scaler** resize with screen resolution.
![Background Setup Anim Portrait](./img/05-main-scene/bg-setup-anim-portrait-2.png)
## Setup Popup Panel ## Setup Popup Panel
### Overview ### Overview
A popup is a temporary UI element that provides additional information or options to the user. A popup is a temporary UI element that overlays the main content to provide additional information or options to the user.
|![Popup overview exit](./img/05-main-scene/popup-disconnet.png)|![Popup overview disconnect](./img/05-main-scene/popup-exit-game.png)|![Popup overview disconnect](./img/05-main-scene/popup-credit-game.png)| |![Popup overview exit](./img/05-main-scene/popup-disconnet.png)|![Popup overview disconnect](./img/05-main-scene/popup-exit-game.png)|![Popup overview disconnect](./img/05-main-scene/popup-credit-game.png)|
|---------------------------------------------------------------|---------------------------------------------------------------------|---------------------------------------------------------------------| |---------------------------------------------------------------|---------------------------------------------------------------------|---------------------------------------------------------------------|

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 KiB

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 183 KiB

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB