56 void setPageTextureByName(
const std::string &pageName,
graphics::Texture *texture);
61 bool play(
const std::string &animationName);
70 void setSpeed(
float speed);
74 void setTime(
float seconds);
88 void setPosition(
float x,
float y);
90 float getX()
const {
return x_; }
92 float getY()
const {
return y_; }
94 void setScale(
float sx,
float sy);
104 void setColor(
float r,
float g,
float b,
float a = 1.f);
115 float getAnimationDuration()
const;
127 bool update(
float dt);
130 void collectDrawItems(std::vector<graphics::DrawItem2D> &out);
138 int getDrawSlotCount()
const;
140 float getDrawSlotX(
int index)
const;
142 float getDrawSlotY(
int index)
const;
144 float getDrawSlotWidth(
int index)
const;
146 float getDrawSlotHeight(
int index)
const;
148 float getDrawSlotRotation(
int index)
const;
150 int getDrawSlotPage(
int index)
const;
152 std::string getDrawSlotRegion(
int index)
const;
158 float x = 0.f,
y = 0.f;
159 float w = 0.f,
h = 0.f;
164 bool rotated =
false;
165 std::string regionName;
166 float u0 = 0.f, v0 = 0.f, u1 = 1.f, v1 = 1.f;
169 void setOwner(
Animation *owner) { owner_ = owner; }
170 Animation *owner()
const {
return owner_; }
172 void rebuildDrawSlots();
173 void checkDrawSlot(
int index)
const;
175 static float sampleFloat(
const std::vector<SpineSkeletonData::FloatKey> &keys,
float time,
177 static void sampleTranslate(
const std::vector<SpineSkeletonData::TranslateKey> &keys,
178 float time,
float &
x,
float &
y);
179 static void sampleScale(
const std::vector<SpineSkeletonData::ScaleKey> &keys,
float time,
181 static std::string sampleAttachment(
const std::vector<SpineSkeletonData::AttachmentKey> &keys,
182 float time,
const std::string &fallback);
184 Animation *owner_ =
nullptr;
185 SpineSkeleton *skeleton_ =
nullptr;
186 SpineAtlas *atlas_ =
nullptr;
187 std::vector<graphics::Texture *> pageTextures_;
189 std::string animName_;
193 bool playing_ =
false;
194 bool paused_ =
false;
195 bool finished_ =
false;
197 float x_ = 0.f, y_ = 0.f;
198 float scaleX_ = 1.f, scaleY_ = 1.f;
200 float r_ = 1.f, g_ = 1.f, b_ = 1.f, a_ = 1.f;
201 std::vector<DrawSlot> drawSlots_;
203 bool hasLastTick_ =
false;
205 bool updateUnchecked(
float dt);
#define EVENGINE_API_WORLD
std::array< float, 4 > rotation
Common time values and an injectable deterministic simulation clock.
Move-only operation result carrying either a value or Status.
Animation module — tween factory + 2D sprite-sheet / Spine + 3D skeletal playback (player / state mac...
Spine animation player + 2D draw collector (region attachments).
SpineAtlas * getAtlas() const
Returns the atlas.
bool isPaused() const
True when paused.
eve::SimulationTick currentTick() const noexcept
Last scheduler tick consumed by this Spine animation.
float getScaleX() const
Returns the scale x.
SpineSkeleton * getSkeleton() const
Returns the skeleton.
void setLayer(int layer)
Sets the layer.
float getX() const
Returns the x.
float getY() const
Returns the y.
void setLoop(bool loop)
Sets the loop.
bool isFinished() const
True when finished.
float getSpeed() const
Returns the speed.
bool getLoop() const
Returns the loop.
SpineAnim(const SpineAnim &)=delete
bool getFlipY() const
Returns the flip y.
float getTime() const
Returns the time.
void setFlipY(bool flip)
When true (default), Spine Y-up is flipped for screen Y-down draw items.
bool hasCurrentTick() const noexcept
Whether this Spine animation has consumed a scheduler step.
float getScaleY() const
Returns the scale y.
int getLayer() const
Returns the layer.
bool isPlaying() const
True when playing.
std::string getAnimation() const
Returns the animation.
SpineAnim & operator=(const SpineAnim &)=delete
Esoteric Spine .atlas text parser (region rectangles + page metadata). Does not load image pixels — b...
Runtime Spine skeleton pose (local + world bone transforms, slot attachments). Script type: SpineSkel...
static constexpr StrongUint64 zero() noexcept
Returns the zero value for this strong type.
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
One deterministic fixed-step emitted by SimulationClock.