Compare commits
1 Commits
92f3ff6f39
...
6d510510af
Author | SHA1 | Date | |
---|---|---|---|
6d510510af |
57
docs/02-setup-main-game/05-main-scene/16-idle-animation.md
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
---
|
||||||
|
sidebar_position: 16
|
||||||
|
---
|
||||||
|
# Idle Animation
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
 
|
||||||
|
|
||||||
|
## Prepare the assets
|
||||||
|
|
||||||
|
| Assets | Description |
|
||||||
|
|--------|-------------|
|
||||||
|
|  | Used to Setup the static sprite frame. |
|
||||||
|
|  | Used to Setup the idle animation. |
|
||||||
|
|
||||||
|
## Setup Idle Animation
|
||||||
|
|
||||||
|
### Configure Settings
|
||||||
|
|
||||||
|
Create the following script:
|
||||||
|
```jsx title="assets/game-assets/scripts/slotty-settings/extend-slotty-setting.js"
|
||||||
|
var BaseSlottySetting = p4fslot.require('slotty-setting');
|
||||||
|
var DIContainer = p4fcore.require('di-container');
|
||||||
|
|
||||||
|
BaseSlottySetting.prototype._registerInjection = function () {
|
||||||
|
DIContainer.Register('cellItemRender', require('idle-cell-item-render'));
|
||||||
|
DIContainer.Register('idleAnimationHandler', require('idle-animation-handler'));
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
### Setup Animations
|
||||||
|
1. Using hepler to generate animation using the prepared assets
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
2. Configure Spine Animation
|
||||||
|
- Set **Is Loop** ✅.
|
||||||
|
- Setup the **Static Sprite Frame** using the prepared assets.
|
||||||
|
|
||||||
|

|
||||||
|
### Configure Scene
|
||||||
|
|
||||||
|
1. Search for the `idle-animation-panel` prefab.
|
||||||
|
2. Drag the "prefab" into "scene".
|
||||||
|
3. Click "Generate Panel".
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
:::warning
|
||||||
|
When using **prefab** directly from **core-assets**, you should convert to **Regular Node**.
|
||||||
|
|
||||||
|

|
||||||
|
:::
|
After Width: | Height: | Size: 63 KiB |
After Width: | Height: | Size: 58 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 372 KiB |
After Width: | Height: | Size: 488 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 97 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 65 KiB |