|
Deki 0.40.1
비주얼 에디터가 있는 2D·3D 모듈식 C++ 엔진
|
이 가이드는 아직 번역되지 않았습니다.
There are two kinds: frames that play one after another, and values that change smoothly over time.
First cut your image into frames: see Sprites. Then:
On your object, add a Sprite Component and an Animation Component, and choose the file in Animation. It plays the first animation when the game runs.
Use the names you gave them:
| Call | What it does |
|---|---|
| PlayAnimation("walk") | Plays it, and leaves it alone if it is already playing |
| PlayAnimationOnce("hit") | Plays it once, even if it loops |
| Pause(), Resume() | Freezes it on the current frame, and continues |
| Stop() | Stops and shows the first frame |
To do something when an animation that does not loop ends:
Calling PlayAnimation every frame is fine: it does not restart what is already playing.
The deki-tween package moves an object without code. Install it from the Package Manager, then add a Tween Component to the object.
| Field | What it does |
|---|---|
| Target Type | What changes: position, scale or rotation |
| End Value | Where it arrives |
| Duration | How long one pass takes, in seconds |
| Ease Type | The shape of the motion. Ease-in-out looks natural for most things |
| Loops | 0 runs once, -1 repeats forever |
| Ping Pong | Goes back again on alternate passes |