Closed JiepengTan closed 3 weeks ago
@JiepengTan What is the relationship between these two:
frameFrom
, frameTo
& frameFps
from
, to
& fps
When should spx-user configure frameFrom
, frameTo
& frameFps
, when shouldn't?
@JiepengTan What is the relationship between these two:
frameFrom
,frameTo
&frameFps
from
,to
&fps
When should spx-user configure
frameFrom
,frameTo
&frameFps
, when shouldn't?
This design is for compatibility with old projects, although it is not very elegant.
Defination of "anitype":
If you need the old behavior (only action, no animation playing), you do not need to configure frameFrom, frameTo , frameFps & anitype.
If configured, it will play an additional animation on top of the previous behavior: frameFrom: The frame where the animation starts frameTo: The frame where the animation ends frameFps: Animation playback speed (how many frames are played per second)
The purpose of fps is to adapt to: loop animations, such as step animations, fps can control the speed of animation playback.
fixed : https://github.com/goplus/spx/issues/300
The animation default (which is bound as defaultAnimation) is played only once while sprite in default state. It is expecetd to be played repeatedly (see details in https://github.com/goplus/builder/issues/603#issuecomment-2180367864)
After animation fight (played by calling animate "fight") finished playing, the sprite does not return to the default state, while it keeps the last csotume of animation fight
https://github.com/user-attachments/assets/6ecd9c07-badf-4ebc-bb53-78f89e34e226
https://github.com/user-attachments/assets/b28027b3-a726-418e-a504-96453bf8edf7
@nighca
@nighca nighca.zip
frameFps: The fps of the animation.
"fAnimations": {
"fight": {
"turnToDuration": 2,
"frameFrom": "__animation_fight_attack_1-1",
"frameTo": "__animation_fight_attack_1-4",
"frameFps": 8
},
"dying": {
"frameFrom": "__animation_dying_dead-1",
"frameTo": "__animation_dying_dead-3",
"frameFps": 8
},
"walk": {
"stepDuration": 0.01,
"frameFrom": "__animation_walk_walk-1",
"frameTo": "__animation_walk_walk-8",
"frameFps": 8
},
"default": {
"frameFrom": "__animation_default_idle-1",
"frameTo": "__animation_default_idle-6",
"frameFps": 16
}
},
@xushiwei Please review this PR; it’s an important fix for the Go+ Builder animation feature.
issue: https://github.com/goplus/spx/issues/300 project file: bug_anim.zip config:![image](https://github.com/goplus/spx/assets/8347962/f1dda9a2-3ad5-4fe4-9c21-fe154c3c225e)
result preview:
https://github.com/goplus/spx/assets/8347962/86e62662-ab2b-4a33-81e3-fae861cfa63e