update setup background main game
@ -93,67 +93,79 @@ The setup is very straightforward by using the `Generate Panel` command in each
|
||||
> - Which helper/p4f menu can be used
|
||||
|
||||
## Setup Background
|
||||
### Background Desktop
|
||||
1. Prepare for **Background Animation**.
|
||||
|
||||
- Assets
|
||||
Background overview:
|
||||
|
||||

|
||||

|
||||
| | Desktop | Mobile |
|
||||
|:-:|--------------|---------|
|
||||
|**Background Landscape**<br/>|<br/>|<br/>|
|
||||
|**Background Portrait**<br/>||<br/>|
|
||||
|
||||
- Node Tree and Properties
|
||||
**Background landscape** use for Desktop and Mobile landscape.
|
||||
|
||||
Animation Provider: We add anim-landscape in desktop assets , it is used for desktop and mobile landscape.
|
||||
**Background portrait** only use for Mobile portrait.
|
||||
|
||||

|
||||
### 1. Prepare the assets
|
||||
| | Assets | Description |
|
||||
|:-:|--------------|---------|
|
||||
|**Static**<br/>||Static background is necessary for the game|
|
||||
|**Animation**<br/>||Animation background may or may not be present, depending on the game design|
|
||||
|
||||
Background Container
|
||||
|
||||

|
||||
|
||||
2. Set up **Background** for **Main Game**.
|
||||
|
||||
- Static
|
||||
|
||||

|
||||
|
||||
If we have animation background, we can remove **Sprite Component** to decrease Drawcall, because we already have static sprite frame on **Spine Animation Component**.
|
||||
|
||||
- Animation
|
||||
|
||||

|
||||
|
||||
### Background Mobile
|
||||
1. Prepare for **Background Animation**.
|
||||
|
||||
- Assets
|
||||
|
||||

|
||||

|
||||
|
||||
- Node Tree and Properties
|
||||
|
||||
Animation Provider: We add anim-portrait in mobile assets, anim-landscape we still use desktop assets.
|
||||
|
||||

|
||||
|
||||
Background Container
|
||||
|
||||

|
||||
|
||||
2. Set up **Background** for **Main Game**.
|
||||
|
||||
- Static
|
||||
|
||||

|
||||
|
||||
If we have animation background, we can remove **Sprite Component** to decrease Drawcall, because we already have static sprite frame on **Spine Animation Component**.
|
||||
|
||||
- Animation
|
||||
### 2. Background Landscape
|
||||
|
||||

|
||||

|
||||

|
||||
- **background-container:** must have **orientation-ui-controller** to display on Landscape with the options below.
|
||||
- **background-main-game:** we use sprite frame from prepared assets.
|
||||
|
||||
Both must add component **Widget** with the options below to resize with parent node.
|
||||
|
||||

|
||||
|
||||
### 3. Background Portrait
|
||||
|
||||
- **moible-background-container:**
|
||||
- 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.
|
||||
|
||||

|
||||
|
||||
### 4. Background Animation
|
||||
|
||||
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.
|
||||
|
||||
2. Using hepler to generate animation.
|
||||
|
||||

|
||||
|
||||
3. We have the result as below, and continue setup for **spine-animation**.
|
||||
- **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.
|
||||
|
||||

|
||||
|
||||
4. Add animation background with component below:
|
||||
|
||||
**Animation background landscape**
|
||||
|
||||
- Add **animation-play-on-anable** with animation name in **Animation Provider**.
|
||||
- Add **background-scaler** resize with screen resolution.
|
||||
|
||||

|
||||
|
||||
**Animation background portrait**
|
||||
|
||||
- **mobile-background-anim-portrait:**
|
||||
- Add **mobile-portrait-background-ui-controller** to display only on **Mobile**.
|
||||
- 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.
|
||||
|
||||

|
||||
|
||||
## Setup Animation Provider
|
||||
|
||||
|
Before Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 87 KiB |
Before Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 77 KiB |
Before Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 113 KiB |
After Width: | Height: | Size: 220 KiB |
After Width: | Height: | Size: 195 KiB |
After Width: | Height: | Size: 190 KiB |
After Width: | Height: | Size: 208 KiB |
After Width: | Height: | Size: 138 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 7.7 KiB |
After Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 85 KiB |
BIN
docs/02-setup-main-game/img/05-main-scene/bg-setup-animation.png
Normal file
After Width: | Height: | Size: 111 KiB |
After Width: | Height: | Size: 13 KiB |
BIN
docs/02-setup-main-game/img/05-main-scene/bg-setup-landscape.png
Normal file
After Width: | Height: | Size: 176 KiB |
BIN
docs/02-setup-main-game/img/05-main-scene/bg-setup-portrait.png
Normal file
After Width: | Height: | Size: 183 KiB |