mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-13 10:38:46 +08:00
Getter for skeleton.
This commit is contained in:
parent
22729a5628
commit
8471e6718d
@ -80,7 +80,6 @@ void SkeletonRenderer::initialize () {
|
||||
|
||||
void SkeletonRenderer::setSkeletonData (spSkeletonData *skeletonData, bool ownsSkeletonData) {
|
||||
_skeleton = spSkeleton_create(skeletonData);
|
||||
_rootBone = _skeleton->bones[0];
|
||||
_ownsSkeletonData = ownsSkeletonData;
|
||||
}
|
||||
|
||||
@ -346,35 +345,31 @@ bool SkeletonRenderer::setAttachment (const std::string& slotName, const std::st
|
||||
return spSkeleton_setAttachment(_skeleton, slotName.c_str(), attachmentName.c_str()) ? true : false;
|
||||
}
|
||||
|
||||
void SkeletonRenderer::setTimeScale(float scale)
|
||||
{
|
||||
_timeScale = scale;
|
||||
spSkeleton* SkeletonRenderer::getSkeleton () {
|
||||
return _skeleton;
|
||||
}
|
||||
|
||||
float SkeletonRenderer::getTimeScale() const
|
||||
{
|
||||
void SkeletonRenderer::setTimeScale (float scale) {
|
||||
_timeScale = scale;
|
||||
}
|
||||
float SkeletonRenderer::getTimeScale () const {
|
||||
return _timeScale;
|
||||
}
|
||||
|
||||
void SkeletonRenderer::setDebugSlotsEnabled(bool enabled)
|
||||
{
|
||||
void SkeletonRenderer::setDebugSlotsEnabled (bool enabled) {
|
||||
_debugSlots = enabled;
|
||||
}
|
||||
bool SkeletonRenderer::getDebugSlotsEnabled() const
|
||||
{
|
||||
bool SkeletonRenderer::getDebugSlotsEnabled () const {
|
||||
return _debugSlots;
|
||||
}
|
||||
|
||||
void SkeletonRenderer::setDebugBonesEnabled(bool enabled)
|
||||
{
|
||||
void SkeletonRenderer::setDebugBonesEnabled (bool enabled) {
|
||||
_debugBones = enabled;
|
||||
}
|
||||
bool SkeletonRenderer::getDebugBonesEnabled() const
|
||||
{
|
||||
bool SkeletonRenderer::getDebugBonesEnabled () const {
|
||||
return _debugBones;
|
||||
}
|
||||
|
||||
|
||||
// --- CCBlendProtocol
|
||||
|
||||
const BlendFunc& SkeletonRenderer::getBlendFunc () const {
|
||||
|
||||
@ -50,12 +50,7 @@ public:
|
||||
virtual void drawSkeleton (const cocos2d::Mat4& transform, uint32_t transformFlags);
|
||||
virtual cocos2d::Rect getBoundingBox () const override;
|
||||
|
||||
// --- Convenience methods for common Skeleton_* functions.
|
||||
void updateWorldTransform ();
|
||||
|
||||
void setToSetupPose ();
|
||||
void setBonesToSetupPose ();
|
||||
void setSlotsToSetupPose ();
|
||||
spSkeleton* getSkeleton();
|
||||
|
||||
void setTimeScale(float scale);
|
||||
float getTimeScale() const;
|
||||
@ -66,6 +61,12 @@ public:
|
||||
void setDebugBonesEnabled(bool enabled);
|
||||
bool getDebugBonesEnabled() const;
|
||||
|
||||
// --- Convenience methods for common Skeleton_* functions.
|
||||
void updateWorldTransform ();
|
||||
|
||||
void setToSetupPose ();
|
||||
void setBonesToSetupPose ();
|
||||
void setSlotsToSetupPose ();
|
||||
|
||||
/* Returns 0 if the bone was not found. */
|
||||
spBone* findBone (const std::string& boneName) const;
|
||||
@ -109,7 +110,6 @@ protected:
|
||||
float* _worldVertices;
|
||||
bool _premultipliedAlpha;
|
||||
spSkeleton* _skeleton;
|
||||
spBone* _rootBone;
|
||||
float _timeScale;
|
||||
bool _debugSlots;
|
||||
bool _debugBones;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user