载入中...
搜索中...
未找到
eve::animation::SpineAnim类 参考

Spine animation player + 2D draw collector (region attachments). 更多...

#include <SpineAnim.h>

Public 成员函数

 SpineAnim (SpineSkeleton *skeleton)
 Spine anim.
 
 ~SpineAnim ()
 Spine anim.
 
 SpineAnim (const SpineAnim &)=delete
 
SpineAnim & operator= (const SpineAnim &)=delete
 
SpineSkeleton * getSkeleton () const
 Returns the skeleton.
 
void setAtlas (SpineAtlas *atlas)
 Sets the atlas.
 
SpineAtlas * getAtlas () const
 Returns the atlas.
 
void setPageTexture (int pageIndex, graphics::Texture *texture)
 Bind a GPU texture to an atlas page (by index or page image name).
 
void setPageTextureByName (const std::string &pageName, graphics::Texture *texture)
 Sets the page texture by name.
 
graphics::Texture * getPageTexture (int pageIndex) const
 Returns the page texture.
 
bool play (const std::string &animationName)
 Play.
 
void stop ()
 Stops .
 
void pause ()
 Pause.
 
void resume ()
 Resume.
 
void setSpeed (float speed)
 Sets the speed.
 
float getSpeed () const
 Returns the speed.
 
void setTime (float seconds)
 Sets the time.
 
float getTime () const
 Returns the time.
 
void setLoop (bool loop)
 Sets the loop.
 
bool getLoop () const
 Returns the loop.
 
void setFlipY (bool flip)
 When true (default), Spine Y-up is flipped for screen Y-down draw items.
 
bool getFlipY () const
 Returns the flip y.
 
void setPosition (float x, float y)
 Sets the position.
 
float getX () const
 Returns the x.
 
float getY () const
 Returns the y.
 
void setScale (float sx, float sy)
 Sets the scale.
 
float getScaleX () const
 Returns the scale x.
 
float getScaleY () const
 Returns the scale y.
 
void setLayer (int layer)
 Sets the layer.
 
int getLayer () const
 Returns the layer.
 
void setColor (float r, float g, float b, float a=1.f)
 Sets the color.
 
bool isPlaying () const
 True when playing.
 
bool isPaused () const
 True when paused.
 
bool isFinished () const
 True when finished.
 
std::string getAnimation () const
 Returns the animation.
 
float getAnimationDuration () const
 Returns the animation duration.
 
void apply ()
 Apply current animation time to skeleton and update world transforms.
 
eve::Result< void > advance (const eve::SimulationStep &step)
 Advance playback by one scheduler-owned deterministic step.
 
bool hasCurrentTick () const noexcept
 Whether this Spine animation has consumed a scheduler step.
 
eve::SimulationTick currentTick () const noexcept
 Last scheduler tick consumed by this Spine animation.
 
bool update (float dt)
 Legacy seconds facade; explicitly forwards to advance().
 
void collectDrawItems (std::vector< graphics::DrawItem2D > &out)
 Append region attachment quads into the shared 2D draw queue.
 
void draw (graphics::Graphics *gfx)
 Draw the current pose into an existing frame without clearing or presenting it.
 
int getDrawSlotCount () const
 Query posed draw slots without textures (for unit tests). Returns number of visible region attachments after apply().
 
float getDrawSlotX (int index) const
 Returns the draw slot x.
 
float getDrawSlotY (int index) const
 Returns the draw slot y.
 
float getDrawSlotWidth (int index) const
 Returns the draw slot width.
 
float getDrawSlotHeight (int index) const
 Returns the draw slot height.
 
float getDrawSlotRotation (int index) const
 Returns the draw slot rotation.
 
int getDrawSlotPage (int index) const
 Returns the draw slot page.
 
std::string getDrawSlotRegion (int index) const
 Returns the draw slot region.
 

友元

class Animation
 

详细描述

Spine animation player + 2D draw collector (region attachments).

Applies bone/slot timelines onto a SpineSkeleton, then emits DrawItem2D quads for the shared 2D queue. Bind atlas page textures before collecting. Script type: SpineAnim.

在文件 SpineAnim.h 第 35 行定义.

构造及析构函数说明

◆ SpineAnim() [1/2]

eve::animation::SpineAnim::SpineAnim ( SpineSkeleton *  skeleton)
explicit

Spine anim.

在文件 SpineAnim.cpp 第 22 行定义.

◆ ~SpineAnim()

eve::animation::SpineAnim::~SpineAnim ( )

Spine anim.

在文件 SpineAnim.cpp 第 26 行定义.

◆ SpineAnim() [2/2]

eve::animation::SpineAnim::SpineAnim ( const SpineAnim &  )
delete

成员函数说明

◆ advance()

eve::Result< void > eve::animation::SpineAnim::advance ( const eve::SimulationStep &  step)

Advance playback by one scheduler-owned deterministic step.

在文件 SpineAnim.cpp 第 294 行定义.

引用了 eve::Applied, eve::Result< T >::failure(), eve::animation::detail::secondsForStep(), step, eve::Status::success() , 以及 eve::Result< T >::success().

被这些函数引用 update().

◆ apply()

◆ collectDrawItems()

◆ currentTick()

eve::SimulationTick eve::animation::SpineAnim::currentTick ( ) const
inlinenoexcept

Last scheduler tick consumed by this Spine animation.

在文件 SpineAnim.h 第 125 行定义.

◆ draw()

void eve::animation::SpineAnim::draw ( graphics::Graphics *  gfx)

Draw the current pose into an existing frame without clearing or presenting it.

在文件 SpineAnim.cpp 第 314 行定义.

引用了 collectDrawItems() , 以及 eve::graphics::RenderSystem::drawItems().

◆ getAnimation()

std::string eve::animation::SpineAnim::getAnimation ( ) const
inline

Returns the animation.

在文件 SpineAnim.h 第 113 行定义.

◆ getAnimationDuration()

float eve::animation::SpineAnim::getAnimationDuration ( ) const

Returns the animation duration.

在文件 SpineAnim.cpp 第 103 行定义.

引用了 eve::animation::SpineSkeletonData::getAnimationDuration() , 以及 eve::animation::SpineSkeleton::getData().

◆ getAtlas()

SpineAtlas * eve::animation::SpineAnim::getAtlas ( ) const
inline

Returns the atlas.

在文件 SpineAnim.h 第 51 行定义.

◆ getDrawSlotCount()

int eve::animation::SpineAnim::getDrawSlotCount ( ) const

Query posed draw slots without textures (for unit tests). Returns number of visible region attachments after apply().

在文件 SpineAnim.cpp 第 460 行定义.

◆ getDrawSlotHeight()

float eve::animation::SpineAnim::getDrawSlotHeight ( int  index) const

Returns the draw slot height.

在文件 SpineAnim.cpp 第 474 行定义.

引用了 h , 以及 index.

◆ getDrawSlotPage()

int eve::animation::SpineAnim::getDrawSlotPage ( int  index) const

Returns the draw slot page.

在文件 SpineAnim.cpp 第 482 行定义.

引用了 index.

◆ getDrawSlotRegion()

std::string eve::animation::SpineAnim::getDrawSlotRegion ( int  index) const

Returns the draw slot region.

在文件 SpineAnim.cpp 第 486 行定义.

引用了 index.

◆ getDrawSlotRotation()

float eve::animation::SpineAnim::getDrawSlotRotation ( int  index) const

Returns the draw slot rotation.

在文件 SpineAnim.cpp 第 478 行定义.

引用了 index , 以及 rotation.

◆ getDrawSlotWidth()

float eve::animation::SpineAnim::getDrawSlotWidth ( int  index) const

Returns the draw slot width.

在文件 SpineAnim.cpp 第 470 行定义.

引用了 index , 以及 w.

◆ getDrawSlotX()

float eve::animation::SpineAnim::getDrawSlotX ( int  index) const

Returns the draw slot x.

在文件 SpineAnim.cpp 第 462 行定义.

引用了 index , 以及 x.

◆ getDrawSlotY()

float eve::animation::SpineAnim::getDrawSlotY ( int  index) const

Returns the draw slot y.

在文件 SpineAnim.cpp 第 466 行定义.

引用了 index , 以及 y.

◆ getFlipY()

bool eve::animation::SpineAnim::getFlipY ( ) const
inline

Returns the flip y.

在文件 SpineAnim.h 第 85 行定义.

◆ getLayer()

int eve::animation::SpineAnim::getLayer ( ) const
inline

Returns the layer.

在文件 SpineAnim.h 第 102 行定义.

◆ getLoop()

bool eve::animation::SpineAnim::getLoop ( ) const
inline

Returns the loop.

在文件 SpineAnim.h 第 80 行定义.

◆ getPageTexture()

graphics::Texture * eve::animation::SpineAnim::getPageTexture ( int  pageIndex) const

Returns the page texture.

在文件 SpineAnim.cpp 第 56 行定义.

被这些函数引用 collectDrawItems().

◆ getScaleX()

float eve::animation::SpineAnim::getScaleX ( ) const
inline

Returns the scale x.

在文件 SpineAnim.h 第 96 行定义.

◆ getScaleY()

float eve::animation::SpineAnim::getScaleY ( ) const
inline

Returns the scale y.

在文件 SpineAnim.h 第 98 行定义.

◆ getSkeleton()

SpineSkeleton * eve::animation::SpineAnim::getSkeleton ( ) const
inline

Returns the skeleton.

在文件 SpineAnim.h 第 46 行定义.

◆ getSpeed()

float eve::animation::SpineAnim::getSpeed ( ) const
inline

Returns the speed.

在文件 SpineAnim.h 第 72 行定义.

◆ getTime()

float eve::animation::SpineAnim::getTime ( ) const
inline

Returns the time.

在文件 SpineAnim.h 第 76 行定义.

◆ getX()

float eve::animation::SpineAnim::getX ( ) const
inline

Returns the x.

在文件 SpineAnim.h 第 90 行定义.

◆ getY()

float eve::animation::SpineAnim::getY ( ) const
inline

Returns the y.

在文件 SpineAnim.h 第 92 行定义.

◆ hasCurrentTick()

bool eve::animation::SpineAnim::hasCurrentTick ( ) const
inlinenoexcept

Whether this Spine animation has consumed a scheduler step.

在文件 SpineAnim.h 第 123 行定义.

◆ isFinished()

bool eve::animation::SpineAnim::isFinished ( ) const
inline

True when finished.

在文件 SpineAnim.h 第 111 行定义.

◆ isPaused()

bool eve::animation::SpineAnim::isPaused ( ) const
inline

True when paused.

在文件 SpineAnim.h 第 109 行定义.

◆ isPlaying()

bool eve::animation::SpineAnim::isPlaying ( ) const
inline

True when playing.

在文件 SpineAnim.h 第 107 行定义.

◆ operator=()

SpineAnim & eve::animation::SpineAnim::operator= ( const SpineAnim &  )
delete

◆ pause()

void eve::animation::SpineAnim::pause ( )

Pause.

在文件 SpineAnim.cpp 第 84 行定义.

◆ play()

bool eve::animation::SpineAnim::play ( const std::string &  animationName)

◆ resume()

void eve::animation::SpineAnim::resume ( )

Resume.

在文件 SpineAnim.cpp 第 88 行定义.

◆ setAtlas()

void eve::animation::SpineAnim::setAtlas ( SpineAtlas *  atlas)

Sets the atlas.

在文件 SpineAnim.cpp 第 30 行定义.

引用了 eve::animation::SpineAtlas::getPageCount().

◆ setColor()

void eve::animation::SpineAnim::setColor ( float  r,
float  g,
float  b,
float  a = 1.f 
)

Sets the color.

在文件 SpineAnim.cpp 第 118 行定义.

引用了 a, b, g , 以及 r.

◆ setFlipY()

void eve::animation::SpineAnim::setFlipY ( bool  flip)
inline

When true (default), Spine Y-up is flipped for screen Y-down draw items.

在文件 SpineAnim.h 第 83 行定义.

◆ setLayer()

void eve::animation::SpineAnim::setLayer ( int  layer)
inline

Sets the layer.

在文件 SpineAnim.h 第 100 行定义.

引用了 layer.

◆ setLoop()

void eve::animation::SpineAnim::setLoop ( bool  loop)
inline

Sets the loop.

在文件 SpineAnim.h 第 78 行定义.

引用了 loop.

◆ setPageTexture()

void eve::animation::SpineAnim::setPageTexture ( int  pageIndex,
graphics::Texture *  texture 
)

Bind a GPU texture to an atlas page (by index or page image name).

在文件 SpineAnim.cpp 第 36 行定义.

引用了 eve::animation::SpineAtlas::getPageCount().

被这些函数引用 setPageTextureByName().

◆ setPageTextureByName()

void eve::animation::SpineAnim::setPageTextureByName ( const std::string &  pageName,
graphics::Texture *  texture 
)

Sets the page texture by name.

在文件 SpineAnim.cpp 第 45 行定义.

引用了 eve::animation::SpineAtlas::getPageCount(), eve::animation::SpineAtlas::getPageName() , 以及 setPageTexture().

◆ setPosition()

void eve::animation::SpineAnim::setPosition ( float  x,
float  y 
)

Sets the position.

在文件 SpineAnim.cpp 第 108 行定义.

引用了 x , 以及 y.

◆ setScale()

void eve::animation::SpineAnim::setScale ( float  sx,
float  sy 
)

Sets the scale.

在文件 SpineAnim.cpp 第 113 行定义.

引用了 sx , 以及 sy.

◆ setSpeed()

void eve::animation::SpineAnim::setSpeed ( float  speed)

Sets the speed.

在文件 SpineAnim.cpp 第 92 行定义.

◆ setTime()

void eve::animation::SpineAnim::setTime ( float  seconds)

Sets the time.

在文件 SpineAnim.cpp 第 97 行定义.

引用了 apply().

◆ stop()

void eve::animation::SpineAnim::stop ( )

Stops .

在文件 SpineAnim.cpp 第 75 行定义.

◆ update()

bool eve::animation::SpineAnim::update ( float  dt)

Legacy seconds facade; explicitly forwards to advance().

在文件 SpineAnim.cpp 第 303 行定义.

引用了 advance(), eve::animation::detail::legacyStep() , 以及 step.

友元及相关函数文档

◆ Animation

friend class Animation
friend

在文件 SpineAnim.h 第 155 行定义.


该类的文档由以下文件生成: