mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
Clean up.
This commit is contained in:
parent
b7ac58b0d2
commit
35b45a564b
@ -42,7 +42,6 @@ bool ExampleLayer::init () {
|
|||||||
if (!CCLayer::init()) return false;
|
if (!CCLayer::init()) return false;
|
||||||
|
|
||||||
skeletonNode = new CCSkeletonAnimation("spineboy.json", "spineboy.atlas");
|
skeletonNode = new CCSkeletonAnimation("spineboy.json", "spineboy.atlas");
|
||||||
skeletonNode->addAnimationState();
|
|
||||||
skeletonNode->setMix("walk", "jump", 0.2f);
|
skeletonNode->setMix("walk", "jump", 0.2f);
|
||||||
skeletonNode->setMix("jump", "walk", 0.4f);
|
skeletonNode->setMix("jump", "walk", 0.4f);
|
||||||
|
|
||||||
|
|||||||
@ -219,11 +219,7 @@ CCRect CCSkeleton::boundingBox () {
|
|||||||
maxY = max(maxY, quad.tr.vertices.y * scaleY);
|
maxY = max(maxY, quad.tr.vertices.y * scaleY);
|
||||||
}
|
}
|
||||||
CCPoint position = getPosition();
|
CCPoint position = getPosition();
|
||||||
minX = position.x + minX;
|
return CCRectMake(position.x + minX, position.y + minY, maxX - minX, maxY - minY);
|
||||||
minY = position.y + minY;
|
|
||||||
maxX = position.x + maxX;
|
|
||||||
maxY = position.y + maxY;
|
|
||||||
return CCRectMake(minX, minY, maxX - minX, maxY - minY);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CCBlendProtocol
|
// CCBlendProtocol
|
||||||
|
|||||||
@ -54,14 +54,17 @@ CCSkeletonAnimation* CCSkeletonAnimation::createWithFile (const char* skeletonDa
|
|||||||
|
|
||||||
CCSkeletonAnimation::CCSkeletonAnimation (SkeletonData *skeletonData)
|
CCSkeletonAnimation::CCSkeletonAnimation (SkeletonData *skeletonData)
|
||||||
: CCSkeleton(skeletonData) {
|
: CCSkeleton(skeletonData) {
|
||||||
|
addAnimationState();
|
||||||
}
|
}
|
||||||
|
|
||||||
CCSkeletonAnimation::CCSkeletonAnimation (const char* skeletonDataFile, Atlas* atlas, float scale)
|
CCSkeletonAnimation::CCSkeletonAnimation (const char* skeletonDataFile, Atlas* atlas, float scale)
|
||||||
: CCSkeleton(skeletonDataFile, atlas, scale) {
|
: CCSkeleton(skeletonDataFile, atlas, scale) {
|
||||||
|
addAnimationState();
|
||||||
}
|
}
|
||||||
|
|
||||||
CCSkeletonAnimation::CCSkeletonAnimation (const char* skeletonDataFile, const char* atlasFile, float scale)
|
CCSkeletonAnimation::CCSkeletonAnimation (const char* skeletonDataFile, const char* atlasFile, float scale)
|
||||||
: CCSkeleton(skeletonDataFile, atlasFile, scale) {
|
: CCSkeleton(skeletonDataFile, atlasFile, scale) {
|
||||||
|
addAnimationState();
|
||||||
}
|
}
|
||||||
|
|
||||||
CCSkeletonAnimation::~CCSkeletonAnimation () {
|
CCSkeletonAnimation::~CCSkeletonAnimation () {
|
||||||
@ -113,7 +116,7 @@ void CCSkeletonAnimation::setAnimationStateData (AnimationStateData* stateData,
|
|||||||
AnimationState_dispose(state);
|
AnimationState_dispose(state);
|
||||||
|
|
||||||
state = AnimationState_create(stateData);
|
state = AnimationState_create(stateData);
|
||||||
states.push_back(state);
|
states[stateIndex] = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCSkeletonAnimation::setMix (char* fromAnimation, char* toAnimation, float duration, int stateIndex) {
|
void CCSkeletonAnimation::setMix (char* fromAnimation, char* toAnimation, float duration, int stateIndex) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user