31 u32 loopMode,
i32 loopCount) {
45 tween.loop_count = loopCount;
46 tween.loops_remaining = loopCount;
47 return tweenEntity.id();
51 if (
auto* sys =
ctx().tryGet<animation::TweenSystem>()) {
57 if (
auto* sys =
ctx().tryGet<animation::TweenSystem>()) {
63 if (
auto* sys =
ctx().tryGet<animation::TweenSystem>()) {
69 if (
auto* sys =
ctx().tryGet<animation::TweenSystem>()) {
78 tween->bezier_p1x = p1x;
79 tween->bezier_p1y = p1y;
80 tween->bezier_p2x = p2x;
81 tween->bezier_p2y = p2y;
92 if (
auto* sys =
ctx().tryGet<animation::TweenSystem>()) {
93 sys->update(registry, deltaTime);
99 return static_cast<i32>(tween->state);
The tween entry points, declared once for both registration layers.
Entity createTween(ecs::Registry ®istry, Entity targetEntity, TweenTarget property, f32 from, f32 to, f32 duration, EasingType easing=EasingType::Linear)
Central container for all entities and components.
T & get(Entity entity)
Gets a component from an entity (must exist).
T * tryGet(Entity entity)
Tries to get a component from an entity.
void anim_resumeTween(ecs::Registry ®istry, u32 tweenEntity)
std::int32_t i32
Signed 32-bit integer.
void anim_updateTweens(ecs::Registry ®istry, f32 deltaTime)
i32 anim_getTweenState(ecs::Registry ®istry, u32 tweenEntity)
constexpr Entity INVALID_ENTITY
Invalid entity sentinel value.
void anim_setSequenceNext(ecs::Registry ®istry, u32 tweenEntity, u32 nextEntity)
void anim_cancelTween(ecs::Registry ®istry, u32 tweenEntity)
void anim_setTweenBezier(ecs::Registry ®istry, u32 tweenEntity, f32 p1x, f32 p1y, f32 p2x, f32 p2y)
std::uint32_t u32
Unsigned 32-bit integer.
void anim_cancelAllTweens(ecs::Registry ®istry, u32 targetEntity)
u32 anim_createTween(ecs::Registry ®istry, u32 entity, u32 targetProp, f32 from, f32 to, f32 duration, u32 easing, f32 delay, u32 loopMode, i32 loopCount)
static EstellaContext & ctx()
EstellaContext & activeCtx()
The engine context every binding routes through — single source of truth.
void anim_pauseTween(ecs::Registry ®istry, u32 tweenEntity)
float f32
32-bit floating point
static constexpr Entity fromRaw(u32 v)
Reconstructs an Entity from a raw packed value.