Mô tả một máy trạng thái animation, dùng với anim_graph_create().
.states = {{.name = "idle", .clip = "idle"},
{.name = "run", .clip = "run"},
{.name = "jump", .clip = "jump", .repeat = 1},
{.name = "attack", .clip = "attack", .repeat = 1}},
.transitions = {
{.from = "attack", .to = "idle", .after_finish = true},
{.from =
"idle", .to =
"run", .when = {{
"speed",
njin::anim_gt, 10}}},
{.from =
"run", .to =
"idle", .when = {{
"speed",
njin::anim_le, 10}}},
}});
anim_graph_handle anim_graph_create(context &ctx, const anim_graph_desc &desc)
Tạo một máy trạng thái animation.
@ anim_le
Tham số nhỏ hơn hoặc bằng value.
Definition njin_anim.h:99
@ anim_false
Tham số bằng 0 (bool đang tắt).
Definition njin_anim.h:103
@ anim_gt
Tham số lớn hơn value.
Definition njin_anim.h:96
@ anim_trigger
Tham số được bật bằng animator_trigger() trong frame này.
Definition njin_anim.h:106
@ anim_true
Tham số khác 0 (bool đang bật).
Definition njin_anim.h:102
anim_sheet_handle sheet
Sheet chứa các clip.
Definition njin_anim.h:159