Spine animation player + 2D draw collector (region attachments). 更多...
#include <SpineAnim.h>
Public 成员函数 | |
| SpineAnim (SpineSkeleton *skeleton) | |
| ~SpineAnim () | |
| SpineAnim (const SpineAnim &)=delete | |
| SpineAnim & | operator= (const SpineAnim &)=delete |
| SpineSkeleton * | getSkeleton () const |
| void | setAtlas (SpineAtlas *atlas) |
| SpineAtlas * | getAtlas () const |
| 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) |
| graphics::Texture * | getPageTexture (int pageIndex) const |
| bool | play (const std::string &animationName) |
| void | stop () |
| void | pause () |
| void | resume () |
| void | setSpeed (float speed) |
| float | getSpeed () const |
| void | setTime (float seconds) |
| float | getTime () const |
| void | setLoop (bool loop) |
| bool | getLoop () const |
| void | setFlipY (bool flip) |
| When true (default), Spine Y-up is flipped for screen Y-down draw items. | |
| bool | getFlipY () const |
| void | setPosition (float x, float y) |
| float | getX () const |
| float | getY () const |
| void | setScale (float sx, float sy) |
| float | getScaleX () const |
| float | getScaleY () const |
| void | setLayer (int layer) |
| int | getLayer () const |
| void | setColor (float r, float g, float b, float a=1.f) |
| bool | isPlaying () const |
| bool | isPaused () const |
| bool | isFinished () const |
| std::string | getAnimation () const |
| float | getAnimationDuration () const |
| void | apply () |
| Apply current animation time to skeleton and update world transforms. | |
| bool | update (float dt) |
| 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 |
| float | getDrawSlotY (int index) const |
| float | getDrawSlotWidth (int index) const |
| float | getDrawSlotHeight (int index) const |
| float | getDrawSlotRotation (int index) const |
| int | getDrawSlotPage (int index) const |
| std::string | getDrawSlotRegion (int index) const |
友元 | |
| 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 第 32 行定义.
构造及析构函数说明
◆ SpineAnim() [1/2]
|
explicit |
在文件 SpineAnim.cpp 第 21 行定义.
◆ ~SpineAnim()
| eve::animation::SpineAnim::~SpineAnim | ( | ) |
在文件 SpineAnim.cpp 第 25 行定义.
◆ SpineAnim() [2/2]
|
delete |
成员函数说明
◆ apply()
| void eve::animation::SpineAnim::apply | ( | ) |
Apply current animation time to skeleton and update world transforms.
在文件 SpineAnim.cpp 第 213 行定义.
引用了 eve::animation::SpineSkeletonData::animation(), eve::animation::SpineSkeletonData::SlotData::attachment, eve::animation::SpineSkeletonData::bone(), eve::animation::SpineSkeleton::getBoneLocalRotation(), eve::animation::SpineSkeleton::getBoneLocalScaleX(), eve::animation::SpineSkeleton::getBoneLocalScaleY(), eve::animation::SpineSkeleton::getBoneLocalX(), eve::animation::SpineSkeleton::getBoneLocalY(), eve::animation::SpineSkeleton::getData(), name, eve::animation::SpineSkeleton::setBoneLocalRotation(), eve::animation::SpineSkeleton::setBoneLocalScaleX(), eve::animation::SpineSkeleton::setBoneLocalScaleY(), eve::animation::SpineSkeleton::setBoneLocalX(), eve::animation::SpineSkeleton::setBoneLocalY(), eve::animation::SpineSkeleton::setSlotAttachmentName(), eve::animation::SpineSkeleton::setToSetupPose(), eve::animation::SpineSkeletonData::slot(), eve::animation::SpineSkeleton::updateWorldTransform(), x , 以及 y.
被这些函数引用 collectDrawItems(), play(), setTime() , 以及 update().
◆ collectDrawItems()
| void eve::animation::SpineAnim::collectDrawItems | ( | std::vector< graphics::DrawItem2D > & | out | ) |
Append region attachment quads into the shared 2D draw queue.
在文件 SpineAnim.cpp 第 396 行定义.
引用了 apply(), eve::graphics::DrawItem2D::color, eve::graphics::DrawItem2D::depthY, getPageTexture(), eve::graphics::DrawItem2D::h, eve::graphics::DrawItem2D::hasOrder, eve::graphics::DrawItem2D::hasUV, eve::graphics::DrawItem2D::layer, eve::graphics::DrawItem2D::order, eve::graphics::DrawItem2D::receiveLight, eve::graphics::DrawItem2D::rotatedUV, eve::graphics::DrawItem2D::rotation, eve::graphics::DrawItem2D::texture, eve::graphics::DrawItem2D::u0, eve::graphics::DrawItem2D::u1, eve::graphics::DrawItem2D::v0, eve::graphics::DrawItem2D::v1, eve::graphics::DrawItem2D::w, eve::graphics::DrawItem2D::x , 以及 eve::graphics::DrawItem2D::y.
被这些函数引用 draw().
◆ draw()
| void eve::animation::SpineAnim::draw | ( | graphics::Graphics * | gfx | ) |
Draw the current pose into an existing frame without clearing or presenting it.
在文件 SpineAnim.cpp 第 293 行定义.
引用了 collectDrawItems() , 以及 eve::graphics::RenderSystem::drawItems().
◆ getAnimation()
|
inline |
在文件 SpineAnim.h 第 79 行定义.
◆ getAnimationDuration()
| float eve::animation::SpineAnim::getAnimationDuration | ( | ) | const |
在文件 SpineAnim.cpp 第 102 行定义.
引用了 eve::animation::SpineSkeletonData::getAnimationDuration() , 以及 eve::animation::SpineSkeleton::getData().
被这些函数引用 update().
◆ getAtlas()
|
inline |
在文件 SpineAnim.h 第 43 行定义.
◆ 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 第 439 行定义.
◆ getDrawSlotHeight()
| float eve::animation::SpineAnim::getDrawSlotHeight | ( | int | index | ) | const |
在文件 SpineAnim.cpp 第 453 行定义.
引用了 h.
◆ getDrawSlotPage()
| int eve::animation::SpineAnim::getDrawSlotPage | ( | int | index | ) | const |
在文件 SpineAnim.cpp 第 461 行定义.
◆ getDrawSlotRegion()
| std::string eve::animation::SpineAnim::getDrawSlotRegion | ( | int | index | ) | const |
在文件 SpineAnim.cpp 第 465 行定义.
◆ getDrawSlotRotation()
| float eve::animation::SpineAnim::getDrawSlotRotation | ( | int | index | ) | const |
在文件 SpineAnim.cpp 第 457 行定义.
◆ getDrawSlotWidth()
| float eve::animation::SpineAnim::getDrawSlotWidth | ( | int | index | ) | const |
在文件 SpineAnim.cpp 第 449 行定义.
引用了 w.
◆ getDrawSlotX()
| float eve::animation::SpineAnim::getDrawSlotX | ( | int | index | ) | const |
在文件 SpineAnim.cpp 第 441 行定义.
引用了 x.
◆ getDrawSlotY()
| float eve::animation::SpineAnim::getDrawSlotY | ( | int | index | ) | const |
在文件 SpineAnim.cpp 第 445 行定义.
引用了 y.
◆ getFlipY()
|
inline |
在文件 SpineAnim.h 第 64 行定义.
◆ getLayer()
|
inline |
在文件 SpineAnim.h 第 73 行定义.
◆ getLoop()
|
inline |
在文件 SpineAnim.h 第 60 行定义.
◆ getPageTexture()
| graphics::Texture * eve::animation::SpineAnim::getPageTexture | ( | int | pageIndex | ) | const |
在文件 SpineAnim.cpp 第 55 行定义.
被这些函数引用 collectDrawItems().
◆ getScaleX()
|
inline |
在文件 SpineAnim.h 第 70 行定义.
◆ getScaleY()
|
inline |
在文件 SpineAnim.h 第 71 行定义.
◆ getSkeleton()
|
inline |
在文件 SpineAnim.h 第 40 行定义.
◆ getSpeed()
|
inline |
在文件 SpineAnim.h 第 56 行定义.
◆ getTime()
|
inline |
在文件 SpineAnim.h 第 58 行定义.
◆ getX()
|
inline |
在文件 SpineAnim.h 第 67 行定义.
◆ getY()
|
inline |
在文件 SpineAnim.h 第 68 行定义.
◆ isFinished()
|
inline |
在文件 SpineAnim.h 第 78 行定义.
◆ isPaused()
|
inline |
在文件 SpineAnim.h 第 77 行定义.
◆ isPlaying()
|
inline |
在文件 SpineAnim.h 第 76 行定义.
◆ operator=()
◆ pause()
| void eve::animation::SpineAnim::pause | ( | ) |
在文件 SpineAnim.cpp 第 83 行定义.
◆ play()
| bool eve::animation::SpineAnim::play | ( | const std::string & | animationName | ) |
◆ resume()
| void eve::animation::SpineAnim::resume | ( | ) |
在文件 SpineAnim.cpp 第 87 行定义.
◆ setAtlas()
| void eve::animation::SpineAnim::setAtlas | ( | SpineAtlas * | atlas | ) |
在文件 SpineAnim.cpp 第 29 行定义.
◆ setColor()
| void eve::animation::SpineAnim::setColor | ( | float | r, |
| float | g, | ||
| float | b, | ||
| float | a = 1.f |
||
| ) |
在文件 SpineAnim.cpp 第 117 行定义.
◆ setFlipY()
|
inline |
When true (default), Spine Y-up is flipped for screen Y-down draw items.
在文件 SpineAnim.h 第 63 行定义.
◆ setLayer()
|
inline |
在文件 SpineAnim.h 第 72 行定义.
引用了 layer.
◆ setLoop()
|
inline |
在文件 SpineAnim.h 第 59 行定义.
◆ 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 第 35 行定义.
引用了 eve::animation::SpineAtlas::getPageCount().
被这些函数引用 setPageTextureByName().
◆ setPageTextureByName()
| void eve::animation::SpineAnim::setPageTextureByName | ( | const std::string & | pageName, |
| graphics::Texture * | texture | ||
| ) |
◆ setPosition()
| void eve::animation::SpineAnim::setPosition | ( | float | x, |
| float | y | ||
| ) |
在文件 SpineAnim.cpp 第 107 行定义.
◆ setScale()
| void eve::animation::SpineAnim::setScale | ( | float | sx, |
| float | sy | ||
| ) |
在文件 SpineAnim.cpp 第 112 行定义.
◆ setSpeed()
| void eve::animation::SpineAnim::setSpeed | ( | float | speed | ) |
在文件 SpineAnim.cpp 第 91 行定义.
◆ setTime()
| void eve::animation::SpineAnim::setTime | ( | float | seconds | ) |
在文件 SpineAnim.cpp 第 96 行定义.
引用了 apply().
◆ stop()
| void eve::animation::SpineAnim::stop | ( | ) |
在文件 SpineAnim.cpp 第 74 行定义.
◆ update()
| bool eve::animation::SpineAnim::update | ( | float | dt | ) |
在文件 SpineAnim.cpp 第 276 行定义.
引用了 apply() , 以及 getAnimationDuration().
友元及相关函数文档
◆ Animation
|
friend |
在文件 SpineAnim.h 第 106 行定义.
该类的文档由以下文件生成:
- src/modules/animation/SpineAnim.h
- src/modules/animation/SpineAnim.cpp